WordPress.org

Ready to get started?Download WordPress

Forums

alternating visitors and admin comments css? (3 posts)

  1. googlebot
    Member
    Posted 6 years ago #

    I was able to get alternating comments colors with this code I found on the forum.

    <?php if ( $comments ) : ?>
    <?php $i = 0; //this creates alternate classes for comments ?>
    <?php foreach ($comments as $comment) : ?>
    <?php $i++; ?>
    <div id="comment-<?php comment_ID() ?>"<?php if($i&1) { echo 'class="commentBox_even"';} else {echo 'class="commentBox_odd"';} ?>>

    Works with no problem, however now I need to highlight admin comments as well, how should I proceed?

    Thanks to everyone.

  2. BPartch
    Member
    Posted 6 years ago #

  3. googlebot
    Member
    Posted 6 years ago #

    I forgot to mention, I already checked all available plugins including the above one, I rather implement this function inside the template code, beside I already have too many plugins active.

    I'm not a coder but I was thinking that would be possible to modified that code to check if the author is admin and apply comment-admin or something along that line.

    Thanks and a happy 2008 to everyone

Topic Closed

This topic has been closed to new replies.

About this Topic