Title: Comments Styling
Last modified: August 19, 2016

---

# Comments Styling

 *  Resolved [ladycrow](https://wordpress.org/support/users/ladycrow/)
 * (@ladycrow)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/comments-styling/)
 * Maybe I’m just missing it. I’d like to style my comments so that alternating 
   comments area unique style.
 * I found a suggestion to do it via the “$oddcomment” method but that’s not working.
   This suggestion was using 2.3 so perhaps something has changed since then.
 * What code would I need to add/alter to achieve this? Just the PHP, the CSS isn’t
   my issue.
 * Thanks in advance!

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

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [17 years, 11 months ago](https://wordpress.org/support/topic/comments-styling/#post-802921)
 * Ladycrow,
 * It’s usually not too hard and the $oddcomment method should work fine. Once you
   can give the comment it’s own class, then it’s just CSS.
 * Which theme are you using?
 *  Thread Starter [ladycrow](https://wordpress.org/support/users/ladycrow/)
 * (@ladycrow)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/comments-styling/#post-802925)
 * I am using NeoSapien. It seemed to be -slightly- outdated and I’ve tweaked it
   a bit. It didn’t have the $oddcomment so I added what I found.. resulting in 
   this
 *     ```
       <?php foreach ($comments as $comment) : ?>
   
       <li class="<?php echo $oddcomment; ?> " id="comment-<?php comment_ID() ?>">
        <?php
          echo get_avatar( get_comment_author_email(), $size = '50', $default = 'http://www.ofsexandlove.com/wp/wp-content/themes/ofsexandlove/images/avatar.jpg' );
          ?>
   
       	<cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> on <?php comment_date() ?> <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite>
       	<?php comment_text() ?>
       	</li>
       <?php /* Changes every other comment to a different class */
           if("altcomment" == $oddcomment) {$oddcomment="";}
           else { $oddcomment="altcomment"; }
       ?>
       <?php endforeach; ?>
       ```
   
 *  Thread Starter [ladycrow](https://wordpress.org/support/users/ladycrow/)
 * (@ladycrow)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/comments-styling/#post-803108)
 * Just wondering if anyone else has any thoughts on this one..?
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [17 years, 11 months ago](https://wordpress.org/support/topic/comments-styling/#post-803111)
 * Sorry, with the profile link not working I could not find this link.
 * I’ll take a look at this when I get home tonight from work, this is pretty easy
   to do.
 *  Thread Starter [ladycrow](https://wordpress.org/support/users/ladycrow/)
 * (@ladycrow)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/comments-styling/#post-803114)
 * No problem. Thanks a lot!
 * It seems my comments file is pretty outdated so I’m going to see if I can swap
   it with the default theme comments.php and if that’ll help any
 * -edit-
    It did help. I’m not even sure how but it’s working so I’ll close this(
   if I can)
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [17 years, 11 months ago](https://wordpress.org/support/topic/comments-styling/#post-803131)
 * Well, that was easy! Good luck with your CSS now 🙂

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

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

 * 6 replies
 * 2 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/comments-styling/#post-803131)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
