Bin-Blog logoBin-Blog

Learn about the latest in Web Development – as soon as I do.

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

By • May 15th, 2009 • Category: Blogging, CSS, WordPress

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.

16 Responses »

  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. Veera says:

    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. Anish K.S says:

    Binny Cool tip 🙂

  4. […] Highlight Author Comments in WordPress without using a WordPress Posted by root 5 hours ago ( WordPress sticker many blogs highlight the author comment in the comments i am binny v a a freelance web developer on the lamp platform 2009 bin blog powered by wordpress entries rss comments rss mimbo theme Discuss  |  Bury |  News | Highlight Author Comments in WordPress without using a WordPress […]

  5. Anish K.S says:

    and its working 🙂

  6. blinkky says:

    Thanks for the tip. I think I’m gonna try it. It’s look cool =)

  7. Danny Brown says:

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

  8. Binny V A says:

    Thanks for the comment guys. Means a lot.

  9. […] Highlight Author’s Comments in WordPress without using a WordPress Plugin […]

  10. Ryan says:

    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.

  11. Amanda says:

    Thank you thank you thank you! Works like a charm, and I couldn’t get any of the plugins to work!

  12. Jal says:

    Simple, quick and gr8. thanks.

  13. Richard says:

    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.

  14. kalyan says:

    It does not work. I have tried it with my blog but it no way makes any differences. Can you reason this? Thanks

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>