WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Child Theme: How To Make Template Changes?

[Resolved] Child Theme: How To Make Template Changes?

  • Hello,

    I remember being lectured not to copy & paste template files from the Parent, into the Child Theme. This causes incompatibility whence themes update?

    How would you make changes to a template file, within a Child Theme?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I usually don’t copy the function.php file, I just create a new function.php file for the child theme with whatever changes I want in there.
    So if you need to make changes to say the header.php you can copy the header.php and make your changes in the child theme.

    As the child theme files are pulled first.
    I will use the page.php to create a new page template.

    I don’t understand your being lectured ‘not’ to copy template files from parent to child. ? anyone??

    If you want to modify a template, the only way is to copy from parent to child!

    I’m not sure who would have lectured, it’s the only way to do it since templates are not usually full of hooks, etc to latch on to

    Of course that rule doesn’t apply to functions.php, but we are all aware of that here!

    I almost always have to copy header.php to my child to modify layout. When a new version comes out, I just run a diff to see what I need to update in my child version. Or copy the new header.php and redo my changes

    Thanks Rev, I was trying to understand why Andrew was lectured!
    Good to know I have been correctly modifying templates.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Child Theme: How To Make Template Changes?’ is closed to new replies.
Skip to toolbar