WordPress.org

Ready to get started?Download WordPress

Forums

Comment Number Background (7 posts)

  1. marzar00
    Member
    Posted 8 years ago #

    G'day,

    This most probably has been covered many times, however I don't like the search on WordPress as I never find what I am after, just heaps of stuff that doesn't relate to the search.

    Anyways, so how do you make it so each comments background is its number. For example the first comment will have a giant 1 in its background and comment number two will have a giant two and so forth.

    Any help is much appreciated.

    Regards
    Marzar00

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    This is how I do it.
    Open comments.php

    <?php $i = 0; ?> <--------put that there
    <?php if ( $comments ) : ?> <---for reference only

    <?php foreach ($comments as $comment) : ?> <--- reference
    <?php $i++; ?> <---------put that there

    And where the comments are to appear:

    <span class="count">
    <?php echo $i; ?>
    </span>

    In the css:
    .count {float:right;font-size:26px;color:#333}

    Post back if needed :)

  3. marzar00
    Member
    Posted 8 years ago #

  4. Mark (podz)
    Support Maven
    Posted 8 years ago #

    You forgot the css.

  5. marzar00
    Member
    Posted 8 years ago #

    Thanks Podz,

    all good and working now

    Marzar

  6. Tempo247
    Member
    Posted 8 years ago #

    Hi!
    I tried the same thing, but it's not counting. The number 1 is displayed for every comment. I suspect that my php skills isn't exactly helping, but I would really like to get this working.

    Any suggestions for a novice?

  7. djsparks
    Member
    Posted 7 years ago #

    I'm using this on my site (http://danielsparks.com/blog/2006/05/06/reading-19/), along with Gravatars. Having trouble with placing the number and the Gravatar in the spots I want them. Would like the comment number to be on the far right, with the Gravatar image immediately to its left.

    Any ideas? Thanks for the great help!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags