Child theme overwriting flies problem
-
On the Child theme Codex page stated:
“If you want to change more than just the stylesheet, your child theme can overwrite any file in the parent theme: simply include a file of the same name in the child theme directory, and it will overwrite the equivalent file in the parent theme directory. For instance, if you want to change the PHP code for the site header, you can include a header.php in your child theme’s directory, and that file will be used instead of the parent theme’s header.php.”
I have a files called post-types.php and register-sidebars.php files in the parent theme that are called by the parent functions.php:
require_once("includes/post-types.php"); require_once( "includes/register-sidebars.php" );
I copied these files in the same directories in the child theme. Now they are showing in the Appearance > Editor, but when I make changes in the child theme files, these changes do not take effect at all. When I change the parent files, on the other hand, the changes applies.
I need to make minor changes to these files, but within my child theme, so I could update my parent theme in the future without any problems.Thank you for your help.
- The topic ‘Child theme overwriting flies problem’ is closed to new replies.