If you own a blog that needs author comments to stand out amongst everyone else, a great way to do so is by using highlighting. Author highlighting can be as much as changing the boarder of the comment box or as much as adding an image or changing the font.
Earlier this week Matt Cutts described a great way to use author highlights, but he only showed how on a basic template. If you are using Brian’s Threaded Comments, your comments.php file looks nothing like the one described, so you might be a little lost. Fear no more! Here are some simple instructions on how to make author highlights work with the Brian’s Threaded Comments plugin:
Within your template folder open comments.php
Change line 52:
<div id="div-comment-<?php echo $c->comment_ID ?>" class='comment<?php echo $odd ?>'>
To:
<div id="div-comment-<?php echo $c->comment_ID ?>" class='comment<?php echo $odd ?><?php if ($c->comment_author_email == "author@youremail.com") { ?> mycomment<?php } ?>'>
Then open your style.css and add:
div.mycomment {
background-color: #fbfbfb;
border: solid 1px #457AA5;
}
Do you have more than one author? Try this:
<div id="div-comment-<?php echo $c->comment_ID ?>" class='comment<?php echo $odd?><?php if ($c->comment_author_email == "author@youremail.com" || $c->comment_author_email == "author2@yourmail.com") { ?> mycomment<?php } ?>'>
For each author just add || $c->comment_author_email == “theirassignedemail@email.com” Be sure to leave a space in between each one!
Don’t worry about others trying to fake your email, WordPress already has it covered. If someone tries to use it, WordPress will catch it and throw it in moderation.
|
|
|
|
|
![]() |
| 2.8 |
If you enjoyed this post, please consider subscribing to my full feed RSS.
Written: Feb 1, 2008Tags: author comments, brian's threaded comments, wordpress, wordpress plugins, wp plugins
Related Articles:
WordPress - Separating Comments from Trackbacks and Pingbacks
WP Plugin: Random Ads
Howto: Manually Install SezWho
Entrecard: the best thing that ever happened to the blogosphere
WP Plugin: SEO Tip of the Day

Gary R. Hess






I’ll have to try that out when I get a chance. I wasn’t sure of what to do at all. Thanks - I’ve been keen to get that plugin working.
It’s a great plugin. I just hate that it is a bit hulky and doesn’t work with some plugins and has some problems with gzip. Oh well, I still use it.
I’m using YATCP though, will have to figure out how to get highlighted comments to work with this.
Just add < ?php if ($c->comment_author_email == “author@youremail.com”) { ?> mycomment< ?php } ?> on line 30 of yatcp_single-comment.php before the closing quote on class= so it should look like class=”< ?php echo $comment_background; ?>”
Then add the CSS stuff in your style.css file.
Thanks, Gary. I’ve bookmarked this to play around with later.
Thank you very much! Works as advertised and looks all the better for it. Fingers crossed that the coming WP2.5 doesn’t break anything.
Hey this is cool, thanks a lot Gary!