About impNERD

impNERD is the place to find information on internet marketing, publishing and tips for web development. Read more »

Subscribe

Subscribe to impNERD via RSS
What is RSS?
Subscribe via e-mail:

WP Plugin: Brian’s Threaded Comments with Author Highlighted Comments

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.

Add to Del.cio.us RSS Feed Stumble It! Zoom It! Add to Sphinn
    www.sajithmr.com

Rate:
2.8

If you enjoyed this post, please consider subscribing to my full feed RSS.

Written: Feb 1, 2008
Tags: , , , ,

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


RSS feed | Trackback URI

7 Comments »

Comment by no imageclairec23 (Who am I?)
2008-02-01 20:00:05

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. :)

Rate:
2.9
Comment by no imageGary R. Hess (Who am I?)
2008-02-02 01:06:27

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.

Rate:
2.9
 
 
Comment by no imageLis (Who am I?)
2008-02-02 02:35:11

I’m using YATCP though, will have to figure out how to get highlighted comments to work with this.

Rate:
2.9
Comment by no imageGary R. Hess (Who am I?)
2008-02-02 12:01:25

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.

Rate:
2.9
Comment by no imageLis (Who am I?)
2008-02-04 06:40:10

Thanks, Gary. I’ve bookmarked this to play around with later.

Rate:
2.9
(Comments wont nest below this level)
 
 
 
Comment by no imageWill (Who am I?)
2008-02-24 22:23:31

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.

Rate:
2.5
 
Comment by no imageTim (Who am I?)
2008-04-13 14:54:29

Hey this is cool, thanks a lot Gary!

Rate:
2.8
 
Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Sponsors

1993 Honda Civic
Hosting Concept
Make money online
PoemofQuotes Blog