How to override php file using child theme
Hello,
I have made some changes to the header file in includes/header-top.php and need to be able to place it in the child theme so that it overrides the parent. I have done some research and found:
require_once( get_stylesheet_directory() . '/includes/header-top.php' );
I added this to the functions.php in the child theme but it is not working.
Do you know of a what for this to happen?
I have made some changes to the header file in includes/header-top.php and need to be able to place it in the child theme so that it overrides the parent. I have done some research and found:
require_once( get_stylesheet_directory() . '/includes/header-top.php' );
I added this to the functions.php in the child theme but it is not working.
Do you know of a what for this to happen?
Comments
theme files can not be included into child theme. Inside child theme, you can use only functions under functions.php file. More details about child theme you can read on https://codex.wordpress.org/Child_Themes
Thanks!