WordPress.org

Ready to get started?Download WordPress

Forums

Help with comments_popup_link (2 posts)

  1. Mr Press
    Member
    Posted 2 years ago #

    I am using the comments_popup_link to display the comment count for posts on both pages and at the top of posts in the following manner:

    <!-- commentcount -->
    <?php
    if ( comments_open() ) :
      echo '<p>';
      comments_popup_link( '', '<span class="onecomment">1 comment</span>', '<span class="morecomments">% comments</span>', '');
      echo '</p>';
    endif;
    ?>
    <!-- end commentcount -->

    It works fine with one exception. If I close the comments after a set time period the comment popup link will disappear from both pages and posts after the time has passed.
    I would like to keep the comment count displaying even after the comments are closed.
    Any ideas?

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    try (totally untested - taking advantage of the fifth parameter):

    comments_popup_link( '', '<span class="onecomment">1 comment</span>', '<span class="morecomments">% comments</span>', '', '<span class="morecomments">% comments</span>');

    http://codex.wordpress.org/Function_Reference/comments_popup_link

Topic Closed

This topic has been closed to new replies.

About this Topic