Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Dishman

    (@dishman)

    This is my first time asking for support and not a good experience. 1st it is a free theme (See my response to the question regarding what theme I used, 2nd I’m trying to learn wordpress child theme coding. There are volumes of support posts regarding how to do x in a child theme when y is in the parent theme. I have scoured the threads here and didn’t find exactly what would work. I found tons of similar issues on turning comments on/off in a child theme. Esmi even posted to some of these threads where someone mentioned using Tutorialicious by Anonymous as their theme!

    Thread Starter Dishman

    (@dishman)

    I am not asking for theme support, just how to code to remove the theme functionality and then put functionality in the child theme. This is not applicable to only this them. You asked about the theme I used, as I didn’t post it originally. I have read MANY other posts on the support forum that were similar in that they were trying to put code in a child theme to prevent theme updates from changing their site. Many of the topics specifically named the parent theme and support was still provided!

    I placed code in the above post. Can anyone help with why it is not working?

    Thread Starter Dishman

    (@dishman)

    I tried this approach in the child functions.php file, but it didn’t work. I don’t know much about coding to see where I went wrong.

    <?php
    function remove_parent_theme_features() {
        // remove Get Comments Template
        remove_action( 'frameshift_post_content_after', 'frameshift_get_comments_template' );
    
        add_action( 'frameshift_post_content_after', 'child_get_comments_template' );
    }
    
    function child_get_comments_template() {
        $child_args = array(
             'comments_posts'        => true,
            'comments_pages'        => true,
            'comments_attachments' => false
        );
    
        $child_args = apply_filters( 'child_get_comments_template_args', $child_args );    
    
        // Extract $child_args
        extract( $child_args, EXTR_SKIP );
    
        if ( is_single() && ! is_attachment() && $comments_posts == true ) {
            comments_template( '', true );
    
        } elseif ( is_page() && $comments_pages == true  && ! is_page_template( 'page-tpl-blog.php' ) ) {
    
            comments_template( '', true );
    
        } elseif ( is_attachment() && $comments_attachments == true ) {
    
            comments_template( '', true );
    
        }
    }
    
    ?>
    Thread Starter Dishman

    (@dishman)

    I downloaded the free version from Themeshift. They also have a premium version. Here is the link: http://themeshift.com/theme/decente/.

    I can pick and choose what comments are active by changing true/false in the parent theme comments.php file and it works well. I just want this switch ability to be in the child theme so that it doesn’t go back to the default page comments = off when the deCente theme is updated.

    Thanks!

    Thread Starter Dishman

    (@dishman)

    Barry,
    Thanks for the response. I was trying to place the events on an existing Events child page. The slug was in fact like: page/event-child.

Viewing 5 replies - 1 through 5 (of 5 total)