Easy Way to Highlight Author Comments with a Different Background Color
4th Feb 2010 | Posted by Eko S. | 23 CommentsAuthor comment to answer reader questions is important. But sometimes the reader have difficulty if an article has a lot of comments, where are the answers from the author? Specially when the discussion is heated, it is very interesting to see author’s thoughts.
In this tutorial we will share the easy way to highlight Author comments in wordpress, without plugin.
The idea is that every comment on the wordpress will form a class. A class that will appear if the author commented, is “bypostauthor” class. In this article we only create a new class in the file style.css on your theme folder.
How to?
First you just need to open your style.css in your template folder and copy this code :
.bypostauthor{ background-color: #D1D1D1 !important; }
Then update your style.css file and the result below…
You can see in this picture I use a color which have code : #d1d1d1
Of course you can change this color accordance with the color you want.
Finished
Finally if you have a problem or do you have another simple way? Please share with us in the comments section below.
22 Comments to “Easy Way to Highlight Author Comments with a Different Background Color”
Add Comments (+)-
-
You have to do an “if statement” that checks to see if the post_authorid and the comment_authorid are the same. Theres a little more to it than adding a class to your css file.
-
-
Hello,
Can i get a one small picture from your blog?-
what kind picture garretot ? can you explain it.
by the way I vistiting your web site it looks not on line, something wrong bro????
-
-
Come On
-
hmm. attractive text ))
-
Hola,
Nombre de http://www.dynamicwp.net a GoogleReader! -
unfortunately it doesn’t work well with nested comments where postauhtor are mixed with others
-
i love all ur stuff dude,.. i will made like this blog ,.. u are inspired me,.
-
how to create this efect but for Administrator User? !important Thanx!
-
Your blog is so informative … keep up the good work!!!!
-
The code is not working. Do we have to add some code to comments.php also?
-
Very helpful indeed.. thanx for the tip
-
Thanks for the tutorial,,i just applied it on my blog and its working..
Hi, Amazing! Not clear for me, how offen you updating your http://www.dynamicwp.net.