• I am working on a new theme for my weblog. At the moment, though, I am stumped on styling the comments. I have it set to alternate background colors, but now I would like to add a special background for just my own comments. Here is the code from my comments.php file so far:

    <div id="commentlist">
    	<?php foreach ($comments as $comment) : ?>
    	<?php $i++; ?>
    	<li id="comment-<?php comment_ID() ?>"<?php if($i&1) {echo 'class="odd"';} else {echo 'class="even"';} ?>>
    	<?php comment_text() ?>
    	<div class="commentby"><cite><?php comment_author_link() ?> — <?php comment_date() ?> at <?php comment_time() ?></cite> <?php edit_comment_link(__("Edit"), ' |'); ?></div>
    	</li>
    	<?php endforeach; ?>
    </div>

    For example, the comments right now alternate from a white backround to a gray backgound, in addition, I would like my comments to show up with say… a blueish background.

    Any ideas on adding to what I’ve got so far?

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