I am looking to edit the header.php file on my website. My parent theme has a header.php file. I copied that file to my child theme and added the necessary code. It seems to be working.
My question is. If the theme developers update the theme, and specifically the header.php file, wouldn't my website ignore their updates since the header.php file is being read from my child theme? Or does it combine the files?
I am looking to edit the header.php file on my website. My parent theme has a header.php file. I copied that file to my child theme and added the necessary code. It seems to be working.
My question is. If the theme developers update the theme, and specifically the header.php file, wouldn't my website ignore their updates since the header.php file is being read from my child theme? Or does it combine the files?
Share Improve this question asked May 7, 2020 at 4:16 VonedaddyVonedaddy 11 Answer
Reset to default 0If you replace a template file using your child theme, then yes, your website will ignore those changes, because the child theme's version will be loaded. There's no way to merge the files. If you want those changes you will need to copy them into your child theme.
This fact has some important implications. If the parent theme changes dramatically enough, then the version of the template in your child theme could no longer be compatible with the parent theme. There's nothing stopping theme authors from making incompatible updates to their parent theme, apart from best practice. However, this shouldn't be too common. If a parent theme is 'child theme friendly' then the developer should avoid these types of updates.