cdeldridge
Member
Posted 1 year ago #
I'm trying to change the background colors for comments in WordPress, but all of the tutorials I can find online are years old and don't seem to work for the newest version of WordPress, or at least I can't seem to figure them out with my lack of knowledge using PHP. Can anyone give me a brief walk-through of how to do this? I'm just using the standard Twenty Ten theme. Thanks in advance.
Here is tutorial for alternating-post-backgrounds-twentyten. See if you can make it work for comments as well:
http://www.transformationpowertools.com/wordpress/alternating-post-backgrounds-twentyten
cdeldridge
Member
Posted 1 year ago #
I followed the tutorial for the post backgrounds and nothing changes. Not sure what I'm doing wrong.
As for the comments one I'm not sure where exactly I put this piece of code:
ul>
<?php $i = 0; ?>
<?php foreach ($comments as $comment) : ?>
<?php $i++; ?>
<li id="comment-<?php comment_ID() ?>"<?php if($i&1) { echo 'class="odd"';} else {echo 'class="even"';} ?></
ul
the < and > on the two "ul"s I removed so it would post.
I've put it where one of the tutorials said to place it and it totally bricked my comments. Any suggestions?
the < and > on the two "ul"s I removed so it would post.
please use the code button instead of the b-quote to keep postes code readable.
a:
you might need to 'reload' the page in the browser to get changes to show (refresching the browser cache); or press 'ctrl' and 'f5' simultanously.
b:
imho, twenty ten already has alternating css classes at the comments:
.even
.odd
.thread-odd
.thread-even
btw:
http://www.rvoodoo.com/projects/wordpress/wordpress-tip-stop-editing-twentyten-theme-use-a-child-theme/