Highlight author comments in WordPress

Martin Brinkmann
Sep 23, 2012
Updated • Sep 23, 2012
Development
|
7

Most WordPress themes iterate between two different comment background colors but do not highlight author or user comments in other ways.  It may make sense to highlight author comments in the comment section of the blog to make it easier to distinguish between reader and author comments. This not only highlights "official" answers in the comment section, as it is also a way to prevent impersonation attempts on the blog.

You may have noticed that you are free to select any name you want when commenting, including the name of the author of the blog post. WordPress does not reserve registered names to prevent this from happening. While careful comment moderation can prevent that from happening, it is still beneficial to highlight author comments in WordPress.

wordpress author comments

WordPress webmasters have several options at their disposal to add author comments. Probably the easiest way to do just that is to install a WordPress plugin. While that may be the easiest way, it is not really something that I'd recommend to use as there are better alternatives available. You will also find third party solutions scattered around on the web that instruct you to add a new CSS style to your code and the style sheet. Those are out of date as well, as there is an even better option available.

The developers have added an author comment style to WordPress 2.7 and newer that you can use to highlight author comments. What you need to do is add a single line to the end of your style sheet to add it to your WordPress blog.

.bypostauthor { background-color:#ccc !important; }

Background-color determines the color used to highlight post author comments. I suggest you take a look at this site for inspiration as it lists 500 color codes for you to use.

You may need to clear the cache if you are using a caching plugin before the changes become visible on the website. If they still do not appear, try forcefully reloading the page with Ctrl-F5.

Advertisement

Previous Post: «
Next Post: «

Comments

  1. Nadeem Khan said on June 29, 2013 at 12:43 pm
    Reply

    It wont work for multi author blogs, right ?

  2. shasha said on October 30, 2012 at 7:55 am
    Reply

    Useful information,Martin

  3. Anonymous said on September 28, 2012 at 3:26 pm
    Reply

    Formula One too.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.