Creating child-theme forgets to replace parent-theme references in /templates
-
Reproduction
- Using TT3 as my theme.
- Customized template “Page”.
Main content area:
Removed the blocks “Post Title” and “Post Comments”.
“Post Content” block the only remaining one. - Also created custom templates “page-title-none” and “page-original-minimally-modified”. Not used anywhere. But important to confirm the bug in your plugin.
- Customized template part “Header”
- Group (with ?? Inner blocks use content width)
- Row (Justification: Space between Items)
- Site Logo , Shortcode block with [maxmegamenu location=max_mega_menu_1] which renders my classical menu in a block theme.
- WordPress → Appearance → Create child theme → Filled all the fields → Generated child theme “tt3dd”.
- WordPress → Appearance → Themes → Activated child theme “tt3dd” as my active theme.
Unexpected outcome:
- In the Site Editor it looked like the customized parent theme had looked.
- But in the frontend I had no header and footer!
Troubleshooting: Found nothing online. Inspected all created files:
wp-content/themes/tt3dd/ parts/ header.html templates/ page.html wp-custom-template-page-title-none.html wp-custom-template-page-original-minimally-modified.html
Cause:
- The bug happens in all
templates/*.html
files. - The plugin had left references to the parent theme
"theme":"twentytwentythree"
all over! - During child theme creation it should have replaced all the references to the slug of the child-theme which is
"theme":"tt3dd"
. - ?</img> After I did that manually, header and footer again appeared in the frontend!
Probably also another bug in the Gutenberg Site Editor / Frontend
After that I also realized why the child theme still had shown correctly in the Site Editor: It still used the parent theme’s page template and header template part which had my customization overrides still in the database!
But when rendering in the frontend it seems to use only the child-theme and not the user customizations of the parent theme, but the user customizations of the child theme (which are NULL in the database then).
This behavioral difference of Site Editor and Frontend is probably a bug of its own, which I will report to the Gutenberg team, and cross link the two reports.
- The topic ‘Creating child-theme forgets to replace parent-theme references in /templates’ is closed to new replies.