• Resolved wpallthetime

    (@wpallthetime)


    I’ve evolved my skills to using child/parent theme. I read the overview (here) and get it.

    I’ve successfully implemented this. And I understand that when I upgrade a parent theme, I’ll need to then confirm if any changes were made in php files (other than functions) that I copied/modified from the parent.

    What is the easiest way to figure out the changes? Do most just compare the two files or is there some tool that will update my child files or is mostly manual work and tracking your code modifications?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t know of any tool to automate it. You can use a diff tool to compare the new parent with the old parent, to see what might have changed (more in detail than just a changelog).
    But mostly, making a child theme shouldn’t involve many files, and mostly additions not changes. That way the parent can update and not affect the child much at all.

    Thread Starter wpallthetime

    (@wpallthetime)

    Thanks Joy. Your response makes sense and that’s fine I’ll just do it manually, it’s still a little easier than without child theme.

    Also what you wrote makes me want to double check if I’m not missing a nuance. I thought that other than functions.php and the stylesheet, I’m should copy other PHP files per this: “any file you add to your child theme will overwrite the same file in the parent theme.”

    If e.g. I copy header.php from parent to child and add to it, then when parent updates, I still need to hunt for my additions and copy into the new header.php (in parent) and then copy that back to child folder. Is that right?

    It’s not really “any file”. It’s “any template file”.
    But yes, if the parent modifies one of the template files that you copied, you would need to merge the changes into your copy, however you go about it.
    Themes can make updates in widgets or Customizer code or template tags (functions) and unless those are pluggable functions that the child theme defined, there’s nothing to do. There could always be a change in one of those functions that affects output, that the child themes doesn’t want, but you can’t just copy any file.
    The things needing changes could be done by filters or in addition to what the parent is doing, so that parent changes don’t affect the child much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Strategy for child/parent themes’ is closed to new replies.