Family Encyclopedia >> Electronics

How to highlight author comments in WordPress

On most sites, it is very difficult for users to track the author's comments. This is why many WordPress sites highlight their author's comment by turning it into a different background color, adding an image, etc. If you want to learn how to highlight author comments in WordPress, you've come to the right place. In this article, we will show you the easiest and simplest way to highlight author comments in WordPress.

Video Walkthrough

Subscribe to WPBeginner

If you don't like the video or need more instructions, continue reading.

By default, WordPress generates a number of CSS classes, making it easy for designers and users to change styles (WordPress CSS Cheat Sheet). Among the default classes that WordPress has added, one of them is specifically aimed at author comments.

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

 .lista de comentarios .bypostauthor .commentlist li ul.children li.bypostauthor 

This doesn't have to be super complex. It is often a fairly simple distinction that highlights the author's comment. For example, Chris Coyier has a top border with a yellow/orange color that makes his comment stand out..

How to highlight author comments in WordPress

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

 .commentlist .bypostauthor border-top: 10px solid # e18728; .commentlist li ul.children li.bypostauthor border-top: 10px solid # e18728; 

Note:We recommend that you change the color to match your color scheme How to highlight author comments in WordPress

Another example would be Matt Cutt's site. He highlights his comment by adding a light background to his comment, while all other comments have a white background.

How to highlight author comments in WordPress

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

 .commentlist .bypostauthor background: # e7f8fb; .commentlist li ul.children li.bypostauthor background: # e7f8fb; 

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

We hope you find a tutorial on how to highlight author comment in WordPress to be useful. The examples above are very simple, but you can go totally crazy and add background images etc. Let us know if he has any questions..