How To Highlight Author Comments In WordPress

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.

Wordpresscomments How To Highlight Author Comments In Wordpress

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.

share on twitter

Comments

  1. sudharsan @ technoskillonline says:

    Intense database plugins for comments will do the tricks for you

  2. Anish K.S says:

    Nice trick, will try the same.

  3. Qasim @ Techie Core says:

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

  4. fareed says:

    nice trick

  5. mAmun_bangladeshi says:

    i cant find first code for replace

  6. Siva says:

    Can’t find
    <li id=”comment-”>

    I think it is not supported in my theme :(

  7. Lynn says:

    <li id=”comment-”>

    is also not in my theme.

Leave a Reply

© 2009-2011 ThemePremium · All Rights Reserved
A threeroutes media Publication