Show No. of Comments Even After Comments Are Closed

Home Pootlepress Academy Support Forums Academy Support Forum WordPress content management Show No. of Comments Even After Comments Are Closed

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10816
    AngieB
    Participant

    Hi Jamie,
    have also posted on Woothemes but hope it will also be of help for the Pootlepress community too.

    In WordPress when commenting has closed on an article, the number of comments following the Read Full Story link on an excerpt is automatically removed and anyone looking at your blog might think no one has made any comments when there could be a substantial number.

    I wanted to let people see the number of comments irrespective of whether comments were closed or not.

    To do this go to the WordPress wp-includes directory and open comment.php

    At the end of the file there is a filter for comments closed. Find the following code and return the false arg to return true after the strtotime code. Highlighted in bold below false has been changed to true.

    $post_types = apply_filters( ‘close_comments_for_post_types’, array( ‘post’ ) );

    if ( ! in_array( $post->post_type, $post_types ) )

    return $open;

    if ( time() – strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) )

    return true;

    return $open;

    }

    You should then still see the number of comments listed even after comments are closed :-)

    #10939
    Jamie Marsland
    Keymaster

    Hi Angie,

    Thank you very much for sharing :)

    All the best,
    Jamie

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Scroll to Top