WordPress.org

Ready to get started?Download WordPress

Forums

Comment numbering (5 posts)

  1. despacho
    Member
    Posted 8 years ago #

    I have some comments on the page and there just going down in a row like this:
    Comment
    -------------

    Comment
    -------------

    but i want the number of the comment in front of it. like this:
    1. Comment
    -------------

    2. Comment
    -------------

    I know that there is a function that lists them, but i really cant find it(maybe im blind). Can someone please help me?

  2. Usayd
    Member
    Posted 8 years ago #

    K2 does it like this:

    <a href="#comment-<?php comment_ID() ?>" class="counter" title="Permanent Link to this Comment"><? echo $count_pings; $count_pings++; ?></a>

    You just stick that in your comments.php file wherever you want it (if your using kubrik i'd say around line 29?)

  3. despacho
    Member
    Posted 8 years ago #

    almost got what i needed. i just used the ? echo $count_pings; $count_pings++; ?> in my comments.php(im not using kubrik), but there only one glitch - the numbering starts from the 2nd comment, not the first. is there a way to fix that?

  4. infoclipper
    Member
    Posted 8 years ago #

    Try:

    <?php echo ++$count_pings; ?>

  5. despacho
    Member
    Posted 8 years ago #

    big thnx! it's just the way I wanted! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags