Highlight Author Comment on wordpress post

0.41K views
no comments
24 Mar 2015 3:06 am

While in custom theme development we need to highlight the post article author comment in comments, I have two technique to highlight the author comment area

first method is best for css and designing purpose, but we want to make different html of comment area or do more code we need second method.

1. wordpress automatically add class comment-author in tag of comment.

.comment-author{ background-color:#FFD700; }

2. We match author email and comment sender email.

$comment_author_email = get_comment_author_email();
if(get_the_author_email() == $comment_author_email) {
$hight_light_class = 'author_comment';
} else {
$hight_light_class = '';
}

Warning for second method

Please do not show author’s email or use secret email eg author_email01@sdtuts.com that other peoples don’t know the author email, otherwise visitors or peoples will send comment on behalf of post author email

NOTE:Your Email Address will be not shown and please do not add spamming comments because here is REL="NOFOLLOW" on your links and comments also moderated shown.
<code>Put html css or any language code under this tag</code>