The difference between you and the commentors is, you are the Blog Author, so your comment must stand out among the rest.
If your current theme does not have this feature, you can do it yourself. We are going to use a little of PHP and CSS here.
Open your theme’s comments.php
Looks for these or similar codes:
foreach ($comments as $comment) :
$comment_type = get_comment_type();
if($comment_type == 'comment') {
?>
...
...
For the codes above, the element that wraps a single comment is a <div> tag. It might be a list <li> tag depends on your theme.
2. Add a css class to it
Let’s call our new css class as admincomment.
Do some edit to the codes above :
foreach ($comments as $comment) :
$comment_type = get_comment_type();
if($comment_type == 'comment') {
?>
...
...
The line user_id == 1) { echo ‘ admincomment’; } ?> simply check if the user id of the commentor equals to 1 (admin’s id is 1). If it is, it will output a string ‘ admincomment’.
3. Open your theme’s style.css
Now add this at anywhere :
.admincomment {
/* how do you want to make yourself outstanding */
background-color: red /*example*/
}
You can add background-image, change background color, etc.
4. Extra
In my zenverse theme, I add a word “Author” above the avatar in admin’s comment.
foreach ($comments as $comment) :
$comment_type = get_comment_type();
if($comment_type == 'comment') {
?>
user_id == 1) {
echo 'Author';
}
?>
...
...
That’s all
Play around with css and html to make yourself special.
Trackbacks
- ZenVerse Styling admin comment in Wordpress | Wood TV Stand
- ZenVerse Styling admin comment in Wordpress | Outdoor Ceiling Fans
- ZenVerse Styling admin comment in Wordpress | Wood TV Stand
- ZenVerse Styling admin comment in Wordpress | fix my credit
- ZenVerse Styling admin comment in Wordpress | patio umbrella
Previous Post
« Host Your Plugin at WordPress.org using Subversion (SVN)
Next Post
A Levels Final Exam »
А как на вашу рсс-ленту подписаться? что то не пойму
Thank you for this site, such as multi information! Thank you!
Great work
Thank you so much for sharing thoughts i hope to read more informative articles on your site soon.
Hi
I’ve been trying to find this tutorial forever. Can you tell me how to include more than one ID? I have two authors each with admin rights and we’d like to style each differently.
Cheers
Great article and share !