May 23, 2011 at 1:18 pm | blabbing.

When you are following a list of comments in a blog post, it can be difficult to pick the comments and responses by the author or admin that can offer much needed fixes, solutions or updates.

If you are looking to make you blog comments easier to scan for you readers, you can easily change the highlighting of comments made by users or the admin by changing the code in your comments.php file. What you need to modify is the <li> or <div> that surrounds each comment in your list. In this example its an <li> tag.

Code for highlighting a comment by any user. Regular comments have a user_id of 0 so anything above that will get a highlight.

<li id="comment-<?php comment_ID() ?>" 
<?php if ($comment->user_id)
      echo "class='NAME OF CSS CLASS'"; 
?> >

Code for highlighting a comment by the admin user. The admin user_id is usually 1 in the user table.

<li id="comment-<?php comment_ID() ?>"  
<?php if (1 == $comment->user_id) 
          echo "class='NAME OF CSS CLASS'";
 ?>>

Some basic highlights to do would be to change the background-color, but you can also add background images to denote super user status like badges or icons.