Highlight Author Comments

Caveat

Unfortunately, due to ill-health, this plugin has not been developed or supported properly for some years. It works with the latest versions of WordPress (including on this website) but could possibly conflict with any WordPress features added after 2008 — e.g. custom post types — if you use them.

Purpose

Highlight Author Comments automatically displays comments made by a post’s author in a distinctive style with no need to edit your template files, etc. All you do is provide a snippet of CSS styling to be applied to author posts.

This is version 1.0.3 download latest version.

  • 1.0.3 accommodates inconsistencies in case of the email addresses used to locate author posts.
  • 1.0.2 adds new option to style the comment author link as well as the comment body; also fixes the collapsing paragraph bug.
  • 1.0.0 is the original version.

Installation Instructions

Highlight Author Comments is installed in 3 easy steps:

  1. Unzip the “Highlight Author Comments” archive and copy the folder to /wp-content/plugins/
  2. Activate the plugin
  3. Use the Options > Highlight Comment admin page to enter the CSS styling you want to apply to author comments.

Frequently Asked Questions

What Do I Enter in the Options Page?

The plugin Options page just has one text box where you put the bit of CSS you want to apply to highlighted comments. Don’t include { or }: just the CSS. For example, by default the plugin applies the CSS padding: 1em which ‘indents’ the comment a little all round. If you wanted to also make the text red, for example, you would use color: red; padding: 1em.

CSS Styling… What’s That?

Cascading Style Sheets (CSS) is too complex a subject to go into here. A good resource is provided by the Web Design Group.

How About Some Examples?

Here’s where some artistry would be a help! In lieu of skill here are some examples to play with:

  1. padding: 1em;
  2. padding-left: 20px;
  3. background-color: #FFFF95;
  4. border-left: 1em solid #DDD; padding: 1em;
  5. background: white url(http://www.yourblog.com/images/fluffy-clouds.gif)
  6. background-color: silver; margin-left: -2em; padding: 1em 1em 1em 2em;
  7. etc.

How Does It Know Which Comments to Highlight?

The plugin simply compares the email of the post author with the email of the commentor. This works fine as long as a post author is logged in when commenting. It will fail if the author is not logged in an uses a different email.

167 replies on “Highlight Author Comments”

  1. Thank you. Great plugin.

    Have 1 question: if I want the background box to have rounded corners (like google adsense) how do I insert that in the CSS code field?

    Can u help me?

  2. adspedia.ro: As it is the plugin only lets you insert css code directly which it them places in an inline style attribute. The plugin code is very simple so if you wanted to you could easily change it to instead insert a class attribute.

    As for rounded corners … they are not straightforward but there are plenty of ways out there. Try googling for ‘css rounded corners’

  3. adspedia.ro: This is a crude hack but…

    Find the line in the plugin that reads:

    return '<div style="'.$options['highlight_style'].'">'.$content.'</div>';
    

    and change it into:

    return '<div class="'.$options['highlight_style'].'">'.$content.'</div>';
    

    Then instead of entering css codes into the options screen enter the name of the class that you want applied to the div that wraps the comment.

    I’m not sure if it will work … but it might.

  4. Correcting a minor bug. The line

    return '<div style="'.$options['highlight_style'].'">'.$content.'</div>';

    Should be

    return '<div style="'.$options['highlight_style'].'"><p>'.$content.'</div>';

    Without the additional ” the author’s first and second paragraphs in his own comment are not properly separated.

  5. David,

    This plugin was breaking the css on the first paragraph of each comment in my theme.

    The change in code in your comment #64 fixed the issue.

    I don’t understand enough of this to know why. Thanks for the fix.

  6. What a great plugin! I’ve been looking for something like this πŸ™‚

    Thanks!

  7. Hmm. This is the third author highlight plugin that has done nothing for me. I am becoming suspicious.

    Plugin is activated, CSS changed and nothing. I do see that my comments have “li author” so something is happening, right?

  8. Cole: Sounds strange! My plugin doesn’t out in the ‘author’ in the <li> element — it’s probably from one of the other alternative plugins you’ve tried. Are any of them still installed?

    This plugin wraps the comment content in a div with a style attribute. It sounds like that isn’t getting added.

  9. I’ve been using the plugin since you released it and have really appreciated your work on this (see comment #13).

    I’ve noticed a problem recently in the HTML on my sites and I don’t know if it is this plugin or not. It goes away when I disable the plugin, so I suspect the plugin, but looking at the code I don’t see how it could be.

    What’s happening is if the admin comment contains multiple lines, the first paragraph does not begin with an open paragraph tag, but it does end with a close paragraph tag. Any idea as to why this might be happening?

    I’ve looked at two of my sites and it happens with one but not the other (different themes). Looking at the themes I don’t see a difference there either. I’m hoping you can shed some light on this.

    Thanks,
    David

  10. David Potter: Hello! See comment #64 above for a solution. For the life of me I thought I had incorporated that fix and updated all the available code. It seems I have only done that in my dreams. D’oh! Anyway I’ll sort it out shortly. Thanks for the nudge/reminder…

  11. Thanks Rob. The fix works great. By the way, I was hoping you would have incorporated my other bug report. Email address comparisons should be case insensitive. Tod od that, replace line 31 with this:

    if (strtolower($comment->comment_author_email) !== strtolower(get_the_author_email()))

    Hope that helps.

    Thanks,
    David

  12. Just wanted to let you know, this plugin does causes Akismet spam not be be shown in the Admin section when using the Greasemonkey script Auntie Akismet Spam. Highlight Author Comments causes trackbacks only (I think) not to be shown then the script runs. Auntie Akismet Spam is a well used Greasemonkey script that puts all of your Akismet spam on one page and combines spam from the same IP address.

  13. I know i’ll sound slow, but, how do I change the font collor on this? I tried just color but it did nothing – ex color: #FFFFFF; tahnks for your help.

  14. Ahhhhh, I am a little slow in some things, I pressed return/enter and was typing it in the next line…. I just needed to press space and keep on typing it out… i thought it was strange because when i erased everything and had only one line, the text would change the color. When I put the spacing in, it would not, so yeah, I just needed to keep on writing insead of hiting return/enter. Thanks, and this is a great plugin. Much appreciated.

  15. Hiya,

    Many thanks for this plugin, worked like a charm! Took me some tries to figure out that you needed to have everything in one line (the text area within the plugin’s settings is a bit misleading there), but it is all working fine now πŸ˜‰

    Cheers again!

  16. Here is my code:
    background-color: #C3DCF1;
    color:#FFFFFF;

    I cannot get the color of the text to change no matter what, could it be it will not override the theme css for some reason?

  17. Oh, and how do you get it to show nothing for for dates and numbers like the other comments? Can I do that thru css in the area you provide us?

Comments are closed.