Title: Comment Styling
Last modified: August 19, 2016

---

# Comment Styling

 *  [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/)
 * I know you can easily highlight the author’s comments. However, is it possible
   to highlight all comments from registered users? For example, I’d like the comments
   from the authors to be highlighted in green, and those from other writers that
   are registered to be blue. Can this be done?

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

 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238757)
 * Most likely … you might want to add a link to your blog with a specific post 
   pointed out that would provide a good example of the comments you want to style.
 * The more information you provide the better chance someone on these forums will
   have a quick (and easy?) answer for your question.
 *  Thread Starter [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238791)
 * The blog is currently being constructed, so I don’t have anything to show what
   I want to do. But here’s an overview so my question is more clear. I want to 
   create unique comment classes based on the following types of commenters:
 * Author of Post: class=”postauthor”
    Writer, but not author of given post: class
   =”author” General user: Regular comment style
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238796)
 * [wp_list_comments()](http://codex.wordpress.org/Template_Tags/wp_list_comments)
   automatically generates .byuser and .bypostauthor classes. If they’re not sufficient,
   you’ll need to look at creating a [custom comment callback](http://codex.wordpress.org/Template_Tags/wp_list_comments#Comments_Only_With_A_Custom_Comment_Display)
   function.
 *  Thread Starter [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238803)
 * I checked the page and did not see any of the tags you mentioned. If they were
   there, that would be perfect for what I’m trying to do!
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238806)
 * You need to examine the source of a page that is created using wp_list_comments
   to see all of the available classes.
 *  Thread Starter [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238808)
 * I mean that I checked the source of a post page and there is no mention of the
   classes you referred to. Should I be looking somewhere else?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238813)
 * You need to look at a page that contain comments generated using wp_list_comments.
 *  Thread Starter [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238822)
 * [http://www.academicperspective.com/](http://www.academicperspective.com/)
 * There’s the URL. Could you tell me what page contains comments generated using
   wp_list_comments?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238825)
 * None. Your theme doesn’t use wp_list_comments right now. You’d need to amend 
   comments.php use that tag instead of it’s current comment listing.
 *  Thread Starter [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238852)
 * I managed to muster up my near non-existent PHP skills and get something working.
   I added this php code immediately after the div class=” for the comment div.
 *     ```
       <?php if($comment->user_id != 0)
       {echo 'usercomment';}
       if(get_the_author_meta('ID') == $comment->user_id)
       {echo ' authorcomment';}?>
       ```
   
 *  Thread Starter [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238942)
 * So I’ve upgraded my theme and now it uses wp_list_comments instead of the legacy
   method. But the .byuser and .bypostauthor aren’t appearing.
 *  Thread Starter [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238943)
 * Anyone know how to make these classes appear?
 *  Thread Starter [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * (@bendrucker)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238964)
 * Bump…

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

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

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [styling](https://wordpress.org/support/topic-tag/styling/)

 * 13 replies
 * 3 participants
 * Last reply from: [bendrucker](https://wordpress.org/support/users/bendrucker/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/comment-styling-1/#post-1238964)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
