Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!


Here is the loop I use for my comments. It's pretty unremarkable except for the little counter I have to make the fancy numbers show up and to alternate backgrounds. I left out most of the file since it's stock WP, here's the comment loop:

<?php foreach ($comments as $comment) : $i++; ?>
	<li id="comment-<?php comment_ID() ?>" <?php if ($i % 2) echo "class='alt'"; ?> >
	<?php comment_text() ?>
	<p><cite><?php comment_type(); ?> <?php _e('by'); ?> <?php comment_author_link() ?> — 
<?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite>
 <span><?php echo $i; ?></span>
<?php edit_comment_link(__("Edit This"), ' |'); ?></p>

<?php endforeach; ?>