• Hi,

    I’m using a child theme. I have two different issues.

    ISSUE 1:

    When I update the stylesheet of the child theme, my website updates flawlessly.

    When I update other template files in my child theme, my website does NOT update.

    Per the instructions on this website, I copied the specific template files that I wanted to edit from the parent theme folder to my child theme folder and edited them. NONE of the edits work. If I go to the parent theme template and make the same edits, the live website updates perfectly. For some reason, the website doesn’t care that I have child themes.

    Why is it that child templates do NOT update my website, but the parent templates do? Are you supposed to do something OTHER than simply copy them from the parent folder to the child folder?

    ISSUE 2:

    When I add code to the child functions.php, it works on the live site, but some things DO NOT? I have to add SOME codes to the parent functions.php for them to work, which doesn’t make any sense. Here’s an example:

    THIS CODE WORKS WHEN ADDED TO MY CHILD FUNCTIONS.PHP:

    add_post_type_support( ‘grfwp-review’, ‘post-formats’, 11 );

    add_filter(‘post_class’, ‘reviews_post_class’);

    function reviews_post_class($classes) {
    if ( ‘grfwp-review’ == get_post_type() ) {
    $classes[] .= ‘post’;
    }
    return $classes;
    }

    BUT ODDLY, THIS CODE DOES NOT WORK WHEN ADDED TO MY CHILD FUNCTIONS.PHP, BUT WORKS IN THE PARENT??:

    function custom_excerpt_length( $length ) {
    return 35;
    }
    add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );

Viewing 2 replies - 1 through 2 (of 2 total)
  • 1. Which templates are you trying to override exactly?

    2. You need to make sure your function gets called after the one in the parent theme. Try this instead:

    function custom_excerpt_length( $length ) {
    return 35;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 9999 );

    Best Regards,
    Dustin Falgout
    Elegant Themes

    Thread Starter joyryde

    (@joyryde)

    I am trying to override the footer.php, which doesn’t work for me, and no-results.php, which also doesn’t work for me.

    I’ve copied them both to my child theme, they both show up in the Appearance > Editor menu for the child theme, but no changes I make to either file appear on the live site.

    Regarding the function custom_excerpt_length code, you fixed it, thank you!! I don’t understand PHP at all!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Updating Child Theme Templates Doesn't Update Live Website’ is closed to new replies.