About impNERD

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

Twitter FriendFeed

Receive Updates

Receive updates via RSS
What is RSS?
Receive updates 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.

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


Receive updates via e-mail:

8 Responses to "WP Plugin: Brian’s Threaded Comments with Author Highlighted Comments"

  • clairec23
    February 1, 2008 @ 8:00 pm

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

  • Gary R. Hess
    February 2, 2008 @ 1:06 am

    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.

  • Lis
    February 2, 2008 @ 2:35 am

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

  • Gary R. Hess
    February 2, 2008 @ 12:01 pm

    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.

  • Lis
    February 4, 2008 @ 6:40 am

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

  • Will
    February 24, 2008 @ 10:23 pm

    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.

  • Tim
    April 13, 2008 @ 2:54 pm

    Hey this is cool, thanks a lot Gary!

  • fadzli
    August 12, 2008 @ 2:47 am

    thanks gary, it’s working great in IE and Safari… but not for FF3.0
    but i manage to make it work by adding the exactly the same code adjustment in briansthreadedcomments.php CSS/Text section
    (right after

    .coment

    section) seems to solve across all browser.

    cheers, **may this become a work-around solution if above doesnt work with your reader’s theme

Leave a Reply