This Tricks original written by AEXT.net and we only share and to make it more clearly, especially for me. How To Highlight Author Comments in WordPress in the right way.
This code is better for the future and better for scalability such as, if you has more than one author in your WordPress site.
Write down Highlight Author Comments Code below
<li class="comment-container
<?php
$authID=get_the_author_meta('ID');
if($authID == $comment->user_id)
$oddcomment = 'authcomment';
echo $oddcomment;
?>" id="comment-<?php comment_ID(); ?>">
...
</li>
Please note, this code above only sample, you’ll need full code on your comment template to make it work, I’m only put on the first area on the WordPress Comment Loop and the closed tags. Then you’ll need to add CSS on your style.css
.authcomment {
background-color: #B3FFCC !important;
}
The Good news is, if you have new version WordPress Comment Loop, you only need added some CSS on your style.css
.bypostauthor { background-color: #B3FFCC !important; }
And done, so if you are the author on current article and added some comment or reply, you comment will be styling differently. I hope this sample make it clear.




Pingback: Tweets that mention How To Highlight Author Comments in WordPress # WordPress Tricks & Tips -- Topsy.com
Pingback: uberVU - social comments
Pingback: WP Tutorial: Remove admin name in comments class | Silver Blog
Pingback: WP Tutorial: Remove admin name in comments class | Unlock IMEI Cellphones
Hi
you saved me. thank you.
hmm.. when i change my template i need to include those codes again n again.. is there any comment highlighter that is compatible with wp 3.0?
Pingback: wp-popular.com » Blog Archive » How To Highlight Author Comments in WordPress # WordPress Tricks & Tips
I’m into learning word press now because our company trains us how to use word press. And it’s a good thing that I have crossed your website. Thank you for posting this!
Great hack
Working fine… Now all my comments looks cool