It’s really hard with the new comment loop. Anybody figure it out??
This was easy to do with the old comment loop. Something like:
<?php $comment_count++; if( $odd = $comment_count%2 ) { $commentclass="oddcomment"; } else { $commentclass="evencomment2"; }
?>
And follow that with a conditional that checks whether the post author is making the comment, and if so, $commentclass = “authcomment”. Finally, call it conditionally in the comment loop:
echo '<div class="' . $commentclass . '">'
(@indyan)
14 years, 11 months ago
I want to highlight comments made by me (uid=2) and otherwise use alternate background colours for comments.
I created three classes in style.css
Now, I want to use authcomment for author comment, oddcomment for all odd no. comments and even comments for all even no. comments.
Can someone please share the code for achieving this. I am not able to implement this properly.
My blog : Pallab dot Net
My full comment file