I'm using the catch-base theme as a parent theme and have the following code in functions.php

function my_theme_enqueue_styles() {

$parent_style = 'catch-base';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-theme',
    get_stylesheet_directory_uri() . '/style.css',
    array( $parent_style )
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );

I for-the-life-of-me cannot figure out how to overwrite any of the template files through the child theme. I have tried the suggestion on the catchthemes website, https://catchthemes.com/blog/create-child-theme-wordpress/ but just using the same directory structure isn't working.

I've also tried adding this code after the "add_action" function, but it breaks the site and gives an "access denied" error.

require_once( get_stylesheet_directory() . '/inc/catchbase-structure.php' ); 

What am I missing?

  • What am I missing is the producer of this "access denied error". it's PHP or the web server ? And wich file do you want to overwrite with the child theme ? the built-in overwriting workk only with parent theme template files – mmm Sep 8 '16 at 19:22
  • I was able to workaround actually replacing the file – Brandon Sep 8 '16 at 19:51

The catch-base theme wraps every function in an if statement to make it easy to modify if necessary.


if (! function_exists('function_name')) { 
    /* some code */

So what I ended up doing was adding this to my functions.php file in the child theme and it overwrote the function and the extra divs that I added showed up!

function function_name() {
    /* some modified code */

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.