How to Highlight Author’s Comments in WordPress

WordPress by default generates a number of CSS classes which makes it easier for designers and users to change the styles (WordPress CSS Cheat Sheet). Among those default classes that WordPress has added, one of those are specifically targeted for styling author’s comments.

The class is called .bypostauthor which can be found in the .commentlist element. All you have to do is add your custom styles by using CSS. For example, you can add your own background, your own image, etc. Note: this code will be found in your style.css file located in your theme’s folder.

Tables can't be imported directly. Please insert an image of your table which can be found here.

1 2

This doesn’t have to be super complex. Often it is a rather simple distinction that highlights author comment. For example, Chris Coyier has a border-top with a yellow/orange color that makes his comment stand out.

To get something like Chris, all you have to do is add this value in those classes:

Tables can't be imported directly. Please insert an image of your table which can be found here.

1 2

Note: we strongly recommend that you change the color to match your color scheme 

Another example would be Matt site. He highlights his comment by adding a light background to his comment whereas all other comments have a white background.

You can do this by adding something like this in your style.css file:

Tables can't be imported directly. Please insert an image of your table which can be found here.

1 2

Again, we strongly recommend that you change the color to match your site’s color scheme.

Was this article helpful?
0 out of 0 found this helpful