I’ve been running this blog for over a year now, and one of my favorite things to do is learn something new, then share it! This is something that won’t apply to everyone, as some already know how to do this, and others may already be using a theme with this implemented.

What I learned to do was add numbers to each of the comments on my site. It’s not overally difficult, so I figured I would share it with everyone. Here are the steps I took to number my comments. I don’t know if this is the best way, but it works!

  1. First thing you will want to do is backup your comments.php file.
  2. Go in to edit your theme and locate the comments.php file.
  3. Locate the code that starts the comment loop. It will look something like this:
    <?php if ( $comments ) : ?>
  4. Place this code immediately above the code in Step 3:
    <?php $i = 0; ?>
  5. Now locate the code that looks like this:
    <?php foreach ($comments as $comment) : ?>
  6. Placed this code immediately below the code in Step 5:
    <?php $i++; ?>
  7. Now use this code where you want to display your comment numbers:
    <span class="count">
    <?php echo $i; ?>
    </span>
  8. Now go to your stylesheet (style.css) and place this code anywhere on the stylesheet:
    .count {
    float:right;
    padding: 12px 25px 0px 0px;
    font-size:24px;
    color:#3B5998;
    }

You can adjust the stylesheet to fit your placement needs. Above is the code I used to place mine as you see it.