• I want to highlight comments made by me (uid=2) and otherwise use alternate background colours for comments.
    I created three classes in style.css

    .authcomment {
    background-color: #050C00;
    }
    
    .oddcomment {
    background-color: #EFE7FC;
    }
    
    .evencomment {
    background-color: #B3FCE8;
    }

    Now, I want to use authcomment for author comment, oddcomment for all odd no. comments and even comments for all even no. comments.

    Can someone please share the code for achieving this. I am not able to implement this properly.

    My blog : Pallab dot Net
    My full comment file

Viewing 1 replies (of 1 total)
  • It’s really hard with the new comment loop. Anybody figure it out??

    This was easy to do with the old comment loop. Something like:

    <?php $comment_count++; if( $odd = $comment_count%2 ) { $commentclass="oddcomment"; } else { $commentclass="evencomment2"; }
    ?>

    And follow that with a conditional that checks whether the post author is making the comment, and if so, $commentclass = “authcomment”. Finally, call it conditionally in the comment loop:

    echo '<div class="' . $commentclass . '">'

Viewing 1 replies (of 1 total)
  • The topic ‘Alternate Comment Colour and Author Highlighting’ is closed to new replies.