WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Alternating Comment Background Colors (4 posts)

  1. jdbanks
    Member
    Posted 8 years ago #

    I've looked, honest, and can't find either plugins or code snippets (for WP2) that will help me alternate between two background colors in the comments. Can someone please point me in the right direction? Thanks!

  2. Chris_K
    Member
    Posted 8 years ago #

    Here's a guide that may help: http://www.tamba2.org.uk/wordpress/altcomments/

  3. jdbanks
    Member
    Posted 8 years ago #

    Thanks, Handy, that was very helpful.

    After ensuring that it worked, I changed the PHP shorthand version...

    <?=($i%2)?"color1":"color2";$i++;?>

    to this (using my own variables and styles)...

    <?php echo ($row_color%2) ? "altRowColor" : "mainRowColor"; $row_color++; ?>

    I guess I did it right, since it's still working.

  4. Chris_K
    Member
    Posted 8 years ago #

    Well good deal. :-) Could you mark this thread as resolved then?

Topic Closed

This topic has been closed to new replies.

About this Topic