WordPress.org

Support

Support » Themes and Templates » Simple Author Highlighting and alternate post highlighting combined

Simple Author Highlighting and alternate post highlighting combined

Viewing 8 replies - 1 through 8 (of 8 total)
  • can we nest an if this for two authors?

    btw very nicely done.

    This is how I addapted it for two authors 🙂

    Then of course make your style sheets different.

    <li class=”<?php if ($comment->comment_author_email == “email1@gmail.com”) echo ‘christopher’; else if ($comment->comment_author_email == “email2@gmail.com”) echo ‘christine’; else echo $oddcomment; ?>” id=”comment-<?php comment_ID() ?>”>

    Is there a way of doing this by fetching the author’s email direct from WordPress?

    Is there a way of doing this by fetching the author’s email direct from WordPress?

    Great question. I would like to be able to do the same!- jeremy

    What if you have 20+ writers on a blog? it wouldnt make sense to go into comments.php each time I have a new user, right? I bet there is a more efficient way.

    Mod to Simon’s original:

    <li class="<?php if ( $comment->comment_author_email == get_the_author_email() ) echo 'authorcomment'; else echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">

    Change the .mycomment class to .authorcomment in the css.

    Thanks Kaf, I was looking at the functions on how to do this, and thought, maybe it’s already been asked in the forums, and lo and behold, it had. Worked like a charm.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Simple Author Highlighting and alternate post highlighting combined’ is closed to new replies.