Support » Fixing WordPress » Child theme

  • We are using the Hemingway theme and created a hemingway-child directory and inserted style.css and functions.php as per the instructions for child themes.

    The child theme shows up under appearance/theme but when activated all the changes made under appearance/customize are gone. In addition we made changes to content.php and placed a copy of the changed file into the hemingway-child directory but it seems the original content.php in the hemingway directory is still the one being used.

    Is there something we are missing to make this work?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Seems I always have a header or footer file needing some changes. What I do is I use a plugin to generate my child themes as that method works every time… so far anyway.

    https://wordpress.org/plugins/child-theme-generator/

    The above plugin will generate a skeleton child theme with the essentials to give you a working child that relies on the present changes (if any) in the parent theme. You’ll still need to move any specific files other than the CSS and Functions file but it’s a good head start.

    Once you have the child theme created you can disable the plugin.

    When starting out with theme changes a good backup is essential! Never rely on your host to provide backups.

    @jnashhawkins Thank you. I’ll check out the plugin. Do you you if it will carry over any changes made using customize of the theme?

    It should but I hardly use the customizer myself and it’s possible an update on the parent might change things. I’d jump into the customizer once the child is enabled and refresh everything there. My guess is the changes on the parent should be reflected there so a quick check and a save should do it.

    That might be covered in the plugin’s documentation… I don’t think I’ve ever looked at that as the plugin just plain works fine on its own.

    It looks like that plugin does the same thing that you did yourself.
    The theme options from the Customizer are saved in one option named for the theme, so activating a child will use the child name so you will see default values and not the values saved with the parent.
    You can use Customizer Export/Import plugin to move the parent values to the child theme.

    One thing that is tricky is getting the style sheet loaded, since there are parent and child files, and the parent has a choice of what to load (parent style, child style, or both). If your child theme looks like the parent, then you’re set, but sometimes you have to load the parent style or the child style or neither.

    For your change to the content.php file, make sure the child uses the same directory structure as the parent, or it won’t be used.

    Thanks for the information. I decided to try another plugin “Child Theme Creator by Orbisius” which worked without a problem. Just clicked on create a child theme and it was done including moving the customize options over. Then moved the modified content.php file into the new child directory and it overrode the theme’s content.php file.

    @sailpilot thanks for using our plugin. Let us know if’d like a feature to be implemented 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.