I have created a child theme.

In the parent theme there is a file functions_custom.php, which has some functions definitions. The file included in functions.php in the parent theme.

Now I want to make some changes in one function that’s in the functions_custom.php file and the function used in single.php to echo some dynamic content.

So how to override that function in child theme?

3 s
3

I am not sure if the function in the functions_custom.php that you wants to override is a pluggable functions like below:

if ( ! function_exists ( 'function_name' ) ) {
    function function_name() {
        // Function Code
    }
}

If it is pluggable function then you can simply write function with same name in your child theme and WordPress will run the Child Theme function first.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *