I have created a child theme for a Theme, Every thing works fine, except there are some files being required in functions.php of parent theme which I want to override it from the child theme. They have used get_template_directory_uri();
instead of get_stylesheet_directory_uri();
. So it's not overriding it. Code used in function.php is:
require( get_template_directory() .'/inc/custom-functions.php' );
I can't change the parent theme or unhook from child theme. What is the best solution to use the child one as I can't call both at a time, resulting into fatal error. I have checked some answers on stackoverflow, but they do not answer exactly.
Child theme - Overriding 'require_once' in functions.php
This answer suggest to use stylesheet instead of template, but I cannot change parent theme.
require
statement, onlyget_template_part
developer.wordpress.org
, just a self hosted site