How To Highlight A Comment From The Author
I have seen many blogs where the author’s comments are shown in a specific way. This makes sense if you - as the author - are answering specific questions. I have seen this on many plugin sites. Marking your comments makes it easier for your visitors to see important answers.
Inspired by the “Author Highlight” plugin for wordpress, I put some simple code into the loop of my comments.php which shows a “This is a comment by the weblog author” note below the date and time of the post:
<?php if(strcasecmp($comment->comment_author_email, 'youraddress@yourhost') == 0)
{
echo "<span style='color:blue; font-weight:bold'>This is a comment from the weblog author.</span>";
}
?>
[Update from 2008-06-24]
Matt Cutts actually describes a nicer method by identifying the author’s ID in this post.
Next post: WordPress Plugin “GoodLinks”
Previous post: The Blog Herald - News For Bloggers
Trackback URI | Comments RSS | Permalink



Comment
#1
You should leave a comment so we can see.
Comment
#2
Ok, here it is. I have slightly changed the CSS, so that by now, you should see a thick border and a light yellow as background color, whereas comments from visitors have a thin border and either white or grey as background color.
Comment
#3
thanks dude