Forums

Adding comment number to index page (2 posts)

  1. lowroller625
    Member
    Posted 2 years ago #

    I am trying to show the number of comments on each post to the index page of http://www.palmettoscoop.com next to the author and the date.

    Here's the code as it is now:

    <div class="top_left_post">
    <?php c2c_get_recent_posts(2, "
    <div class=\"rightside_index_entry\"><h2>%post_URL%</h2>%post_excerpt%
    <div class='cpl_postmeta'>Continue Reading: %post_URL_short%
    By %post_author% | %post_date%</div></div>","34"); ?>
    </div>

    All I can find is the comments_number php to be used inside the loop. But it doesn't work here.

    How can I get the comment number to appear after %post_date% on the same line and in the same font, etc.

  2. Edward Caissie
    Member
    Posted 2 years ago #

    Try adding this at the point you want your comment number to appear:

    <?php comments_popup_link(__('0'), __('1'), __('%'), '',__('-')); ?>

    This will show only the number of comments. You can read more about the function here: http://codex.wordpress.org/Template_Tags/comments_popup_link

    Hope that gets you pointed in the right direction ...

Topic Closed

This topic has been closed to new replies.

About this Topic