How to transfer changes to a child theme?

There are three core principles to parent/child theme logic in WordPress:

  1. functions.php files from both parent and child get executed during load, with the child one first (this is a little counter-intuitive so worth remembering).

  2. “Template directory” refers to parent theme and “stylesheet directory” refers to child theme. If no child theme is being used they are same and both refer to single current theme.

  3. Each template file is first looked for in child theme, then in parent theme. Note that this natively works for template files only and not theme files in general (such as arbitrary files with PHP code).

So for modification of template files they are typically copied over to child theme and edited there.

Modification of other files is case by case and depends on availability of hooks and how flexible parent theme is about that specific functionality.

Leave a Comment