• I am in the process of creating a child theme, where the parent was generated by “Block Theme Generator” (https://fullsiteediting.com/block-theme-generator/). According to the best practices I have read, one should copy the templates to be modified from the parent’s template directory into the child’s template directory. I have done so, yet updates I make through the Editor are not reflected in the child’s corresponding template. Nor is the parent template affected. Nor do new templates appear in the in the child’s template directory. However, they do appear in the “All templates” list.

    Out of interest, I’d like to know where these changes are recorded.

    But in practical terms, need I be concerned? Will I be able to introduce updated versions of the parent’s templates without loosing my changes?

    In advance of deployment, I am running a development environment on my Mac, using WordPress version 6.2, with MAMP running PHP7.4.33, Apache Web Server.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @billher

    From the research I was able to do it seems like like there might be an issue with the way the child theme is set up. When creating a child theme, ensure that the parent theme is properly enqueued in the child theme’s functions.php file, and any modified templates are correctly located in the child theme’s template directory.

    There are a few guides that might be helpful in double-checking the setup of the child themes:

    1. WordPress.org Child Themes Handbook: Overview with best practices and troubleshooting
      Link: https://developer.wordpress.org/themes/advanced-topics/child-themes/
    1. Smashing Magazine: in-depth article covers everything you need to know about child themes
      Link: https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/
    1. WPBeginner: How to Create a WordPress Child Theme (Step by Step) tutorial walks you through the process of creating a child theme, including how to properly enqueue the parent theme’s stylesheet and how to modify templates.
      Link: https://www.wpbeginner.com/wp-themes/how-to-create-a-wordpress-child-theme-video/
    1. WPMU DEV: Troubleshooting Child Theme Issues in WordPress: This article offers some common solutions to issues you may encounter when working with child themes, such as templates not updating or child themes not appearing in the dashboard.
      Link: https://premium.wpmudev.org/blog/troubleshooting-child-theme-issues-in-wordpress/

    About losing the changes you’ve introduced to updated versions of the parent’s templates, if you have correctly set up your child theme and modified the templates in the child theme’s directory, then you should be able to safely update the parent theme without losing your changes. Not a bad idea to make a backup of your child theme and database before making any updates, just in case.

    Lastly, I can’t say with the utmost certainty where the changes are recorded, but I did find this thread that seems to answer a similar question, so I’m linking that here too: https://wordpress.org/support/topic/changelog-for-themes/

    Hoping that I have found some relevant information to help address some of the theme issues you’re experiencing and have provided you with relevant links.

    Moderator bcworkz

    (@bcworkz)

    Be discerning when reading support articles about child themes. There are two different theme schemas: “classic” and “block”. All older support articles are most likely about classic themes. If you are creating a child block theme, ensure the article you’re reading is for block themes and not classic.

    Classic theme templates reside in the theme’s root folder and are PHP based.

    Block theme templates reside in the theme’s /templates/ folder and are HTML based.

    Thread Starter billher

    (@billher)

    Thanks Jonathan ((@jpantan) for taking the time to collect all those references (the WPMU DEV link appears to be broken). I have reviewed them (taking into consideration @bcworkz caution) and made some adjustments but the problem persists. Unfortunately I’m not a coder so the nuance of the php eludes me. In any case, I can say there is a difference between the child and parent themes, as confirmed by switching between the two. The files however are unaffected by changes.

    I’ll continue to fiddle with it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Location of Templates’ is closed to new replies.