(+84) 463.28.7979

How to Highlight Author’s Comments in WordPress


In blog posts that generate high amount of discussion, it often becomes hard for users to track the author’s comment. Specially when the discussion is heated, it is very interesting to see author’s thoughts. In this tutorial we will share one of the easiest and simplest way to highlight author’s comments in WordPress.

There are few plugins that does this job, but you don’t need a plugin to do it. Most snippets will target and try to find author’s email, but that actually slows your site down. Why not find author’s id and change the background color so it is easily pointed out.

First you need to open your style.css in your template folder and add the following:

.authorstyle { background-color: #B3FFCC !important; }

Then you need to open your comments.php which is also located in your themes folder and find the code that looks some what like this:

<li <?php echo $oddcomment; ?>id=”comment-<?php comment_ID() ?>”></li>

Replace it with:

<liauthorstyle”; echo $oddcomment; ?>”></li>

Note you must change 1 to the user id of the author. Once you do this, your blog comments will have a different background for the author’s comment compared to the rest.

Thanks to Matt Cutts for this tutorial.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>