help me implementing a third row
Posted: Thu Feb 05, 2009 4:03 pm
Hello guys. I'm just trying to alternate my background in the comments of my site - three colours which will repeat -, and I'm a kind of newbie in PHP even in the basics so I need your help.
I just get it working with two. Here it is what I have by now :
Then in my CSS I set up an .odd background and a .even background.
How could I add a third row here ?
Thanks
I just get it working with two. Here it is what I have by now :
Code: Select all
<ol>
<?php $i = 0; ?>
<?php foreach ($comments as $comment) : ?>
<?php $i++; ?>
<li <?php if($i&1) { echo 'class="odd"';} else {echo 'class="even"';} ?>>
<?php comment_text() ?>
</li>
<?php
endforeach;
?>
</ol>How could I add a third row here ?
Thanks