Skip to content

Export: Getting Template part has been deleted or is unavailable: header after uploading to a new site #242

@oskosk

Description

@oskosk

While working on a theme created from scratch with Create Block Theme I opted to export the theme using the Export the activated theme with user changes option:

image

I got a zip bundle and uploaded to another site. On that new site I visited the editor and was shown a message Template part has been deleted or is unavailable: header (footer as well).

image

Workaround

I noticed then that the templates/index.html file part of the bundle created by the export was referring to the header part like this:

<!-- wp:template-part {"slug":"header","tagName":"header","theme":"new blank theme"} /-->

... while my original file (the one generated from scratch) read:

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

After removing "theme":"new blank theme" the template worked properly loading the index part.

How to reproduce

  1. On a fresh site, install Create Block Theme
  2. Visit Appearance -> Create Block Theme
  3. Create a blank theme. Name it Le Theme.
  4. Activate the Theme in Appearance -> Themes
  5. Export the theme: Visit Appearance -> Create Block Theme and export the theme. Keep the downloaded bundle somewhere.
  6. Deactivate and delete the recently created theme Le Theme: Visit Appearance -> Create Block Theme, switch to Twenty Twenty-Three, then delete Le Theme.
  7. Upload and activate the downloaded zip from step 5.
  8. Visit the Editor.
  9. Confirm the part is missing. Expect to see Template part has been deleted or is unavailable: header and Template part has been deleted or is unavailable: footer messages.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions