Skip to main content
Easily create better & faster websites with the Total WordPress Theme Learn More
(opens a new tab)
Tutorials

How to Highlight Author Comments in WordPress

How to Highlight Author Comments in WordPress

One of the cool features of the premium theme I am currently working on is that comments made by the author of the post will be a light blue as opposed to the default gray color. What is great about highlighting author comments is that readers will notice right away when the author has replied to their comments (ideal in community type blogs). And even better yet, it super easy to do. Below is a very simple guide showing you the CSS class you can use to target your author comments differently.

Highlight Author Comments In WordPress Instructions

WordPress by default includes custom classes for your comments that allow you to style them different. One of these unique classes is “bypostauthor” which is a unique class added to all comments made by the author of the current post allowing you to style comments by the post author differently then comments by readers.

Here is some example CSS you can add to your site that will make the comments by the post author blue:

.bypostauthor {background: #ffff99;}

This code should be added in your style.css file (preferably a child theme if you are using a theme by another developer) or via a Custom CSS plugin. If you notice that nothing happens when you enter that code, then most likely your theme hasn’t been coded correctly and you will need to contact the author of the theme so they can fix and update their theme accordingly.

Author Comment Highlight Example

Here is a quick screenshot of the comment structure of the premium theme I am currently working on. As you can see the default comments are gray and the author comments are blue.

Highlight WordPress Author Comments

If my instructions weren’t helpful maybe the highlighting author comments guide by Matt Cutts would be helpful so you should go check them out.

How to Display “Badges” in Your WordPress Comments

Another great way to “highlight” comments is to display the user type/role of the person leaving the comment (subscriber, contributor, author, administrator). Luckily we’ve created a free plugin you can use to automatically add these “badges” to your WordPress site. Simply download, install and activate our Comment User Badge Plugin for WordPress. Below is a little screenshot example showing how it would look.

comment-user-badge

How Do You Highlight Comments?

We know there are many ways of highlighting comments to make some stand out or make it easier for your visitors to have meaning full conversations via your comments. Let us know what you do on your WordPress site in the comments below!

2 Comments
  1. SparkJunction · 12 years ago

    Google seems to be able to index comments… at least Facebook, probably Disqus and perhaps even WordPress comments… I’m also pretty sure they’ll start using all of these for ranking sites!

    • Kyla · 8 years ago

      Definitely. Comments provide unique content for your site so the more comments your site has the more unique content it will have as well. I do believe it will help your SEO efforts when you have high quality comments on your site that add value to your posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

Learn how your comment data is processed by viewing our privacy policy here.