Title: Comment ID
Last modified: August 18, 2016

---

# Comment ID

 *  [bk](https://wordpress.org/support/users/bk/)
 * (@bk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/)
 * `php comment_ID()`
    When I add that, it shows me the total number of comment.
   I’m trying to make when people leave a comment on a new posts, it starts from
   1, 2, and so on.
 * How to do that?

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [oriecat](https://wordpress.org/support/users/oriecat/)
 * (@oriecat)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250135)
 * You just want an ordered list of the comments? Or you want to actually have the
   comment ID changed? I don’t think you can do the latter, because the comment 
   ID comes from the database and each ID has to be unique.
 *  Thread Starter [bk](https://wordpress.org/support/users/bk/)
 * (@bk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250144)
 * Yeah, sure. Ordered list of comments would work. Is there a way to do it?
 *  [oriecat](https://wordpress.org/support/users/oriecat/)
 * (@oriecat)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250203)
 * Change the ul to an ol.
 *  Thread Starter [bk](https://wordpress.org/support/users/bk/)
 * (@bk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250237)
 * In what though? The `comment.php` file? o_O
    Take [this site](http://www.sonsofskadi.net/index.php/extended-live-archive/)
   for example. The number of the right side of the comments. Is that what ol is
   for? Or do you use something else?
 *  [jalenack](https://wordpress.org/support/users/jalenack/)
 * (@jalenack)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250240)
 * You won’t be able to pull that off with an ordered list. You’ll need a simple
   count on the loop. To clarify, the loop is `foreach ($comments as $comment)` 
   Edits in comments.php of your template file:
 * Before this code:
    `<?php foreach ($comments as $comment) : ?>` Add this: `<?
   php $com_count = 1; ?>` Then, inside the loop, where you want the number to appear,
   add this: `<?php echo $com_count++; ?>`
 *  Thread Starter [bk](https://wordpress.org/support/users/bk/)
 * (@bk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250254)
 * Do I have to create a file? Like `theloop.php` or something?
 *  [jalenack](https://wordpress.org/support/users/jalenack/)
 * (@jalenack)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250268)
 * no, go to your theme directory (/wp-content/themes/*****YOURTHEME****/) and open
   comments.php . This is the template file that displays the comments. You should
   find the stuff above somewhere in the middle. The loop is just a name for the
   foreach() statement that is used to display comments
 *  Thread Starter [bk](https://wordpress.org/support/users/bk/)
 * (@bk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250271)
 * Can’t seem to position it. Could you please check [my comment page](http://www.xeenat.com/2005/08/17/xbox-360-price-announced/#comments).
 *  Thread Starter [bk](https://wordpress.org/support/users/bk/)
 * (@bk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250272)
 * And how can I increase the size of them. If I put like h2 or h3, a big gap is
   shown then. I know this has to do with CSS, but how exactly would I do it?
 *  Thread Starter [bk](https://wordpress.org/support/users/bk/)
 * (@bk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250292)
 * Anyone?
 *  [Minna](https://wordpress.org/support/users/minna/)
 * (@minna)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250293)
 * You’ll need to wrap it (the <?php echo … ?>) in a <span>, or <div> actually, 
   and give it a class. For example <div class=”comment_number”><?php echo $com_count
   ++; ?></div>. And then you can modify it in the CSS (float it left/right, change
   size etc.). Maybe a span would float too. I don’t know 🙂
 * I have something like
    `div.comment_number { font-size: 250%; float: right; }
   in the css
 *  Thread Starter [bk](https://wordpress.org/support/users/bk/)
 * (@bk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250294)
 * Thanks a lot Minna!!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Comment ID’ is closed to new replies.

 * 12 replies
 * 4 participants
 * Last reply from: [bk](https://wordpress.org/support/users/bk/)
 * Last activity: [20 years, 9 months ago](https://wordpress.org/support/topic/comment-id/#post-250294)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
