How To Highlight Author Comments In Wordpress

by furhead on February 15, 2010

WooThemes - Made by Designers

If you are using Wordpress as your blogging platform then you must have at some point of time thought of- How can I highlight author or admin comments of  Wordpress blog.

Here is a simple way to highlight the author comments in thesis theme and any other Wordpress theme as well.

How to highlight author comments in Wordpress Thesis theme:-

Their is not much to it,just copy paste the following code in your custom.css file

/* admincomments */
.custom dl#comment_list dt.bypostauthor,children dd.comment, .custom dl#comment_list dd.bypostauthor>div {background: #c9d7e5; padding-top:20px;}

How to highlight author comments in any wordpress theme(other than thesis )

In your themes root footer open the comments.php file and find the following code

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

Replace this code with the code below

<li class="<?php if ($comment->user_id == 1) $oddcomment = "admincomments"; echo $oddcomment; ?>"

Put this code in your style.css or custom.css  depending on theme you use.

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

You can change the color to your liking and according to your theme.

If you find this tip useful for you and for others, don’t forget to tweet and share this post.

Related posts:

  1. Wordpress Premium Theme for Gadgets Blogs
  2. Disable Wordpress Post revision Without Plugin
  3. Wordpress Plugin To Edit Posts And Comments Without Logging In
  4. Wordpress Problem wp-includes/pluggable.php on line 865 [Solved]
  5. Wordpress Security: Restrict wp-content and wp-includes on wordpress using htaccess

WooThemes - WordPress themes for everyone

{ 5 comments… read them below or add one }

sudharsan @ technoskillonline February 19, 2010 at 8:21 pm

Intense database plugins for comments will do the tricks for you

Reply

Anish K.S March 5, 2010 at 9:28 am

Nice trick, will try the same.

Reply

Qasim @ Techie Core March 12, 2010 at 4:22 pm

I am Unable to do that…
Cant find the mentioned codes in Comment.php

Reply

fareed March 25, 2010 at 12:18 pm

nice trick

Reply

mAmun_bangladeshi April 8, 2010 at 2:18 pm

i cant find first code for replace

Reply

Leave a Comment

Previous post:

Next post:

.