• Resolved Blutarsky

    (@blutarsky)


    I am using a child theme to partially change theme’s beahviour. CSS is fine, but how can you partially modify PHP? I am not talking about functions in functions.php, but If I need to partially change the page template or the post template? Can I achieve this? Or do I need to keep a copy of the PHP file in my Child theme folder? This would mean that every change to the theme would require adjustments in my modified PHP files….

Viewing 2 replies - 1 through 2 (of 2 total)
  • You copy the PHP file from the parent theme into the child theme’s directory and then make your changes to the one in the child theme. Leave the one in the parent directory alone. WordPress loads the files in the child theme directory if they exist and if not, the parent theme.

    Now, yes, if the parent theme is updated via WordPress updates, if one of the PHP files that is updated is in both the child and parent theme, the one in the child directory will still load. If you want to incorporate the changes then you need to use WinDiff or something to know the differences.

    Thread Starter Blutarsky

    (@blutarsky)

    Thanks a lot for clarifying! I will go for the Windiff solution. Perfect!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Modifying child theme PHP files’ is closed to new replies.