How To Highlight Author’s Comment In Your WordPress Site ?

You can Highlight Author Comments automatically in a distinctive style in your WordPress site.

Highlighting author comment can be done either by plugin or hack. If you find using plugin more easy then use Highlight Author Comments plugin. Its hasn’t been updated in over 2 years but it works fine. After activating it visit Dashboard->Settings->Highlight Comment admin page and enter CSS styling you want to apply to author comments.

If you like using hack then follow these steps:

Step-1 Open your theme’s style.css file and add the following code:

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

Step-2 Open your theme’s comments.php file and find code looking like:

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

Step-3 Replace the above given code with this:

<li class=”<?php if ($comment->user_id == 1) $oddcomment = “authorstyle”; echo $oddcomment; ?>”></li>

Step-4 Now change 1 (in above code)  to the user id of the author.

That’s all. Now your blog comments have a different background for author’s comment.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.