Highlight Author’s Comments in WordPress without using a WordPress Plugin

WordPress Sticker

Many blogs highlight the author’s comment in the comments section. You can use many plugins to get this effect(For eg., the Highlight Author Comments Plugin) – but you don’t have to. You can get the get the same effect by adding a small bit of code to your theme.

The Changes

Just open up the style.css file in your active and add this at line at the end…

.bypostauthor { background-color:#aaa !important; }

Change the #aaa to the color you want as the author comment’s background. That’s it – you’re all done.

Note: This will only work on 2.7+ version of WordPress – if you are using an older version, please read the instructions in this post.

About Binny V A 102 Articles
Freelance Web Developer on the LAMP Platform. Maintains a blogs http://blog.binnyva.com/. Other sites include Bin-Co and OpenJS

14 Comments

  1. Oh yea, the next instalment to the plugin killer series!

    I wished I had read this a lot earler, I was looking for this one with my last theme, I googled a lot, but nothing really worked. Even the plugin you said above, it didnt work for me either.

    (And I even wrote to QOT for the piece of code, he gave me a link, that didnt work either, maybe I was doing the wrong things all the time)

    But then it was not WP 2.7, so it wouldnt have worked anyway..

    Then the new theme came with this one pre-installed. I was saved! 🙂

  2. Cheers for this – I’ve been messing with various plugins to try and do this, yet this is the simplest solution I’ve found. Just updated my blog now – much better! 🙂

  3. Hope you don’t mind me blowing my own horn, but I’ve created a tutorial that takes this one step further and uses background images to style threaded comments, and different background images to highlight the comment of any specified logged-in user who leaves a comment. You can find it here.

2 Trackbacks / Pingbacks

  1. Highlight Author Comments in WordPress without using a WordPress | Outdoor Ceiling Fans
  2. Plugin Killer Series for WordPress: The End | Bin-Blog

Leave a Reply to Richard Cancel reply

Your email address will not be published.


*