Just upgraded one of my themes (the only one I’m still using that I can truly say I’ve created myself) to finally utilize WordPress 2.7’s new comment listing function. This made separating actual comments from pings a breeze compared to what it used to be.
The only slight problem was with porting the old separation of every other comment with a different class; since I needed to use a custom callback to retain the old look, I couldn’t utilize the automated classification done by wp_list_comments()
. In the end all it took was these three lines added to my callback function:
global $comment_alt; $oddcomment = $comment_alt % 2 ? 'alt' : ''; $comment_alt++;
With these in place I could now bring in the <li> tag from the old template without any further tweaking:
<li id="comment-<?php comment_ID() ?>" class="<?php echo $oddcomment?>">