Title: Comments style
Last modified: August 18, 2016

---

# Comments style

 *  [mc82](https://wordpress.org/support/users/mc82/)
 * (@mc82)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/comments-style/)
 * I have two questions about styling comments.
 * 1. I see that alot of blogs are able to format every other comment a different
   style, how do they do this?
 * ie.
    comment 1 – blue background comment 2 – white background comment 3 – blue
   background comment 4 – white background and so on and so forth..
 * 2. How can I distinguish a comment that is posted by me (or a specific author)?
 * any help would be great. thanks.

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

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/comments-style/#post-173211)
 * 1. One (among many) threads that discuss options for this:
 * [http://wordpress.org/support/topic.php?id=12668](http://wordpress.org/support/topic.php?id=12668)
 * 2. And more:
 * [http://codex.wordpress.org/Answers-Layout#Change_Comment_Styles_.2F_Colours](http://codex.wordpress.org/Answers-Layout#Change_Comment_Styles_.2F_Colours)
 *  [Avenir](https://wordpress.org/support/users/avenir/)
 * (@avenir)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/comments-style/#post-173215)
 * The official comments plugin:
    [http://inner.geek.nz/archives/2005/01/12/wp-plugin-official-comments/](http://inner.geek.nz/archives/2005/01/12/wp-plugin-official-comments/)
 * The alternating background is done with PHP. Add this somewhere at the beginning
   of the `comments.php` file:
 * `<?php
    $odcomment = ''; ?>
 * Then, on the `<li>` or whatever element it is you use to display the comments,
   add a class `class="<?php echo $odcomment; ?>"`.
 * Then, after you do that, but still within the `foreach` comment loop, add this:
 * `<?php
    if ( $odcomment == 'graybox' ) { $odcomment = ''; } else { $odcomment
   = 'graybox'; ?>
 * And then add a style in your CSS file for the graybox class.
 * This is ripped straight from the default theme, by the way. It’s not invention
   of mine.

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

The topic ‘Comments style’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Avenir](https://wordpress.org/support/users/avenir/)
 * Last activity: [21 years, 1 month ago](https://wordpress.org/support/topic/comments-style/#post-173215)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
