Best practice for child-theme files to become loaded?
-
I was just wondering what was the best way to implement a child theme:
I have my child-themes files ready now there’s one file that is called in the functions.php like this:
require get_template_directory() . '/inc/custom-header.php';
By using the get_template_directory-function, the child-themes custom-header.php file won’t be used, but the parent-themes one.
I modified the parent theme like this:
require locate_template( 'inc/custom-header.php' );
This way, a child-themes file has precedence and it’s file is used instead of the parent themes one.
However, I can’t go this path, because an update will kill my changes. What is the proper way, to integrate my file?
I would also like to contribute this code change, but it seems like there is no way to submit such an improvement. How do I do this?
- The topic ‘Best practice for child-theme files to become loaded?’ is closed to new replies.