Block theme not exporting header and footer
-
I have used your block theme plugin and till couple of weeks ago it was working fine then now suddenly when I export the theme its not exporting header and footer.
I have spent all day, I cleared browser cache. I cleared removed all files on computer /downloads folder with the theme name to avoid conflicts but nothing works.Also the theme home page when i checked its html its directing to a pattern called home.php which is hidden.
Do you guys have any answer for this.
-
I have used your block theme plugin and till couple of weeks ago it was working fine then now suddenly when I export the theme its not exporting header and footer.
Hi @khangood I would like to check this on my end, which option from the plugin did you use to create a block-based theme? Also what is the name of the theme you are manipulating, is this a default twenty* theme?
I am not able to replicate this when I create a clone or child theme for the default Twenty Twenty Three theme. This is why I am asking.
I am having the same (or similar) problem. I created a theme named “MyNewsTheme” by –
- first using the “Create Blank Theme”
- adding templates, template parts, creating headers and footers and a navigation menu (named “navt”) that is part of the site’s “Main Header”, (I plan to have multiple headers for different sections, and all will share the same “navt” top navigation drop down menu (the main hamburger menu).
I have tried various combinations to export the theme, (I am developing it on “example.biz” and want to import it to “example.com” when it’s ready for production).
No matter which way I try to export it; e.g. – Just using Export MyNewsTheme or Clone MyNewsTheme, or even first trying Overwrite MyNewsTheme then trying Export or Clone…
I lose the header and footer content. The Template Parts “header” and “footer” are there, but contain a single block named “pattern” that is greyed out in the site editor, and does not display anything on the front end of the site.
I have Gutenberg installed as well as Create Block Theme. I have tried (over several days) to overcome the problem, even doing a clean install, and same problem.
RELATED POSSIBLE: I do notice an error when leaving the Site Editor after making changes to template parts and templates — after clicking “SAVE” in upper right, when I try to back out, I get another “SAVE” button in lower left corner and an alert warning me “Changes you made may not be saved.” if I click “LEAVE”. If I have made several changes, instead of the lower left “SAVE” button I get a “REVIEW # CHANGES” button, with a “SAVE” in the pop-up that has checkboxes to ok the various changes — when I click “SAVE” there it says site updated — but when I try to back out to the Site Editor menu it warns me that changes won’t be saved if I “LEAVE” — I can try to “”REVIEW # CHANGES” / “SAVE” over an over, but the alert persists.
ALSO RELATED POSSIBLE: I see the Site Editor creates multiple versions of a template or template part, (e.g. two instances of “header”, or headers with new names if I create them, etc)… It shows who created each one, or if it’s an original part or template from the theme — but it also loses all the header and footer content in any template or template part and replace it with a blank “pattern”.
Hi @thelmachido, I’m using TT3 theme and heavily customized it. It was good couple of weeks ago. But now while i was ‘exporting’ the theme and afterwards I install it on different host its stopped working ‘header’ and ‘footer’ missing.
Note : I’m using ‘export’ option not ‘clone’ or new theme option.
I have run a theme check, no problems there. So theme is good.
Thank you!
Hi
I too have this issue when trying to create a child theme from the Spectra One theme. The Header and footer template parts missing. I tried it twice one making a few changes and another making no changes, both resulted in missing template parts.
I contacted their support and they said they recreated the issue too, then sent me a link to a Github project (https://github.com/WordPress/gutenberg/issues/37128)
Thanks
Hey folks – thanks for the additional reports. If I can please ask you to check one thing with your newly exported theme – does the new folder name match the theme slug?
Sometimes this issue can happen if you upload a theme using a zip with a name different to the theme slug (?
mytheme(5).zip
?is uploaded to?/mytheme-5/
?instead of?mytheme
).?Hi @jordesign
My previous child theme exports were all two words for the theme name. So i just tried with a single word and it still brought up the missing template parts error.
thanks
Hi @jordesign, I used the exact theme folder and slug mytheme.zip. No mytheme(1).zip or mytheme(2).zip like that.
does the new folder name match the theme slug
jordesign (@jordesign)At first yes, then pretty sure it didn’t (after a few rounds of Overwrite, Clone and/or Export in CBT), then unzipping on local machine and at times replacing or deleting some templates or parts — then re-ZIP-ing and uploading to test site…
I’ll try again.
I am also having the same (or similar) problem. and like others above I’ve tried all the options including exporting as a Clone.
The Header & Footers don’t appear on the alternate site.
Interestingly if I create it as a child theme then apply to the actual site I’ve customised it also looses the headers & footers
I’m not entirely sure how the solution will be implemented, but the problem stems from the
theme
attribute being set on thetemplate-part
blocks. If set, that attribute has to EXACTLY match the folder structure of where the theme resides, making it very possible that themes imported into different environment won’t work.The solution is to remove the attribute from themes that are saved/exported. This fixes things most of the time. I believe that’s done if a theme is saved/exported from the CBT editor interface. I’m not sure if the result is different via the wp-admin interface.
The kicker, though, is that if a
template-part
block is referenced from apattern
then it MUST have thetheme
attribute or it won’t work. But as we established above it has the potential to not work in other environments. Thus the solution there is to NOT include anytemplate-part
blocks in patterns.If you’re having trouble with themes exported (either from Gutenberg or Create Block Theme) then removing those theme attributes SHOULD make things work as expected. This issue is probably the best one to watch regarding what’s going on. Once CBT has a reasonably solid fix it will be noted there.
- This reply was modified 1 year, 5 months ago by Jason Crist.
- This reply was modified 1 year, 5 months ago by Jason Crist.
To Add a symptom
I tried to use the option – Overwrite Twenty Twenty-Three
[Save USER changes as THEME changes and delete the USER changes. Your changes will be saved in the theme on the folder.]Immediately after it completed the Header & Footers were missing as was some styling.
I did not export the theme or use it elsewhere, Just the site I was working on.
….
Hi
Today I tried creating a child theme on version 1.13.0, Got the error mentioned in other posts about the zip being invalid and downgrading to PPHP7.4 fixed that.
So created a child theme of Spectra One theme and the template parts issue persists, but interestingly i created a child theme of the default 2013 and the template parts issue didn’t appear.
Thanks
Done some more testing today and found that creating a child theme of the default 2023 theme works, but if the theme is made by a 3rd party the template parts don’t work.
Cloning works fine, regardless of who developed the theme
So i can only come to the conclusion that something in 3rd party themes is being referenced and needs to be redirected to the child theme name somehow
Thanks
Just wanted to chime in that I’m also experiencing the issue of template parts and patterns getting lost after overwriting my custom theme using the Create Block Theme plugin.
My “Front Page” loses the header, footer, and template parts. All other pages keep the Header/Footer, but lose template patterns.
I’ll look into the theme naming.
- The topic ‘Block theme not exporting header and footer’ is closed to new replies.