Highlight Author’s Comments in WordPress without using a WordPress Plugin
By Binny V A • May 15th, 2009 • Category: Blogging, CSS, WordPress
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.
Bin-Blog
Follow me(@binnyva) on Twitter
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!
Now this blog supports author highlighting – my comments will have a darker shade background. When I did my research, google gave me nothing as well. But when I took a look at the code, the feature was already present.
Oh yea! I can see that already… (the darker shade)
Cool. This is much simpler in Wordpress 2.7. In earler version, I’d to manually add the the style class to author comments!
Binny Cool tip
[...] Highlight Author Comments in WordPress without using a WordPress Posted by root 5 hours ago (http://www.bin-co.com) 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 [...]
and its working
Thanks for the tip. I think I’m gonna try it. It’s look cool =)
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!
Thanks for the comment guys. Means a lot.
[...] Highlight Author’s Comments in WordPress without using a WordPress Plugin [...]
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.
Thank you thank you thank you! Works like a charm, and I couldn’t get any of the plugins to work!
Simple, quick and gr8. thanks.
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.