I’m using a Kubrick-based theme (Letterhead), and while this code seems to work fine (nice job BTW), it doesn’t seem to want to supercede the alt
class comment colors no matter what I do. Anyone else having an issue with this? Any workaround ideas?
For example, if I post a comment as the author, it will give me my special author
class for the comment only if the alt
class is not set in the comment loop with the variable $oddcomment
. When $oddcomment
is set to alt
, I’ll get a grey box instead of the expected yellow author highlight. If $oddcomment
is not set to alt
, then I can get the author highlight. The value of $oddcomment
alternates with every iteration of the comment loop. I’ve tried using a conditional to put priority on the author
class, but no luck.
My code showing my simple hack that doesn’t work:
<?php
$authorcomment = '';
if($comment->comment_author_email == get_the_author_email()) {
$authorcomment = 'me'; }
?>
<li class="<?php
// MY HACK HERE:
if ($authorcomment=='me') echo $authorcomment;
else echo $oddcomment;
?>" id="comment-<?php comment_ID() ?>">