Alternating comment row colors in wordpress 3 (4 posts)

  1. scottbrown
    Posted 6 years ago #

    Hi there,

    I want each comment to display a different background color, this is nothing new but none of the old methods seem to work in wordpress 3 - The code seems to have changed since the odd/even method was the standard way to achieve it.

    comments are listed with:

    <?php if ( have_comments() ) : ?>
    	<h2><?php comments_number('No Comments', '1 Comment', '% Comments' );?></h2>
    	<ol class="commentlist">
    	<?php wp_list_comments(); ?>

    Any help appreciated.

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    The odd and even classes work for me. Check the page source and you'll see what classes are being generated.

  3. Misuko
    Posted 5 years ago #

    esmi: I believe the issue here is to maintain the features implemented by wp_list_comments(); (ie. threaded comments) while having comments of alternating colours.

    Which, incidentally, is what I would like to know how to do as well.

  4. Misuko
    Posted 5 years ago #

    Well, whatever, I'm using one of the many commenting APIs now.

Topic Closed

This topic has been closed to new replies.

About this Topic