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.

15 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. Cool. This is much simpler in WordPress 2.7. In earler version, I’d to manually add the the style class to author comments!

  3. 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! 🙂

  4. It’s funny how one little line of code can replace a whole plug in for WP. Good thinking though, I will have to try this out.

  5. 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.

  6. Binny you have done a great job and i really appreciate it so, from by my side thanks alot for your work hope to see it in your next update.

3 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
  3. Easiest Way to Highlight Author’s Comments – Okayarms.com

Comments are closed.