Steps to highlight admin or author’s comments:
1)
Paste this:
.authcomment {
background-color: #B3FFCC !important;
}
At the end of (assuming your theme name is default and you are running xampp on local to test):
C:\xampp\htdocs\wp-content\themes\default\style.css
2)
C:\xampp\htdocs\wp-content\themes\default\comments.php
remove or comment out this:
<li id=”comment-<?php comment_ID() ?>”>
or
<li class=”<?php echo $oddcomment; ?>” id=”comment…
AND PASTE THIS (MAKE SURE YOU REMOVE DOUBLE QUOTES ” AND RETYPEWRITE THEM):
<li class=”<?php
/* Only use the authcomment class from style.css if the user_id is 1 (admin) */
if (1 == $comment->user_id)
$oddcomment = “authcomment”;
echo $oddcomment;
?>”
C:\xampp\htdocs\wp-content\themes\default\comments.php
3) REFRESH THE PAGE IF YOU HAVE ALREADY ADDED COMMENTS AFTER LOGIN TO YOUR BLOG.
Tweet This Post