feed Posts (RSS | eMail)
feed Comments (RSS | eMail)
Loading...

Please consider signing the Google Gmail Automatic BCC Option Petition
and spread the word. Thanks!

I need more signatures - at least, help me reach the 100 for starters! :-)
[click box to close]

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 different method by identifying the author’s ID in this post. [Update] That only works if you are logged in while commenting - otherwise, the user_id is “0″ and the highlighting won’t show.

The post ends here. Wanna leave a response? Have Your Say!
BTW: This post has comments.

Next post: WordPress Plugin “GoodLinks”
Previous post: The Blog Herald - News For Bloggers

Trackback URI | Comments RSS | Permalink

del.icio.us del.icio.us eMail this post eMail Print Print
Did you like this post? NoYes
So far, 1 users have voted this post +1.
Loading ... Loading ...

Comments

  1. This is
     Comment 
    #1
     stephen
    2007-11-10 @ 22:11:53 +0100 (CET) | Reply | Quote | Permalink

    You should leave a comment so we can see. ;)

  2. This is
     Comment 
    #2
     Marco
    2007-11-11 @ 11:02:58 +0100 (CET) | Reply | Quote | Permalink

    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.

  3. This is
     Comment 
    #3
     stephen
    2007-11-11 @ 17:48:18 +0100 (CET) | Reply | Quote | Permalink

    thanks dude

  4. This is
     Comment 
    #4
     Article
    2008-11-07 @ 13:46:28 +0100 (CET) | Reply | Quote | Permalink

    It is a great way and really eye catching though… I am wondering if it is compitable with WP 2.7 Beta as well. Thanks alot, regards


Have Your Say!

back to top