Differentiate the author’s comments on a blog

Why seek to differentiate your own comments on your blog?

Because it will allow your visitors to identify and easier to follow the conversation. Some themes for WordPress offer this feature by default, but here’s a quick guide to differentiate the author’s comments.

unique-2

 

Locate the style attributed to comments

Look in your stylesheet (usually style.css file) style applied to comments. It should look like this:

[sourcecode language=”css”]
comment {
background:#3F3F3F;
margin:0 0 6px;
padding:12px 12px 6px;
}[/sourcecode]

Create a second style for the author’s comments

Now you’ll create a second class that applies to the author’s comments. The simplest is to use the same style with changing the background color. Your style will look like this:

[sourcecode language=”css”]
comment-author {
background:#3E3E3E;
margin:0 0 6px;
padding:12px 12px 6px;
}[/sourcecode]

Locate the loop to display the comments

Then open the comments.php file and find the loop that allows the display of all comments:
Inside is the function that calls the class that stylized comments.

Insert a condition

Just  add a condition for the class how author-created earlier is called if the author of the commentary is also the author of the ticket:

[sourcecode language=”php”]
<?php
if($comment->user_id == $post->post_author) {
$class = ‘comment-author’;
} else {
$class = ‘comment’;
}
?>
<div>
<?php comment_text() ?>
</div>[/sourcecode]


You May Also Like

Pay Per Post companies – Part1

Blog writing has emerged as a popular cultural phenomenon these days. Not only does a blog act as a wonderful tool for self expression on the Internet but it also offers a chance to make some money. There are a lot of services which can help a blogger to earn a good amount of money […]

How to Make Money $ by Adding Amazon Prime to Your Blog

Amazon offers a chance to earn easy money by becoming an Amazon associate. Being an Amazon Associate you can easily make a lot of money by simply adding certain features to your blog or website. One such feature is the Amazon Prime. Amazon Prime has to be just linked with all the Amazon products featured […]

USPA Nationwide Security Opens Doors in Tulsa Oklahoma

Leading Security Guard Company to Bring New Jobs to the Local Area July 17, 2020 // TULSA OKLAHOMA – USPA Nationwide Security, one of the nation’s top providers of security guards and fire watch services, today announced the official opening of its latest location, USPA of Tulsa Oklahoma, to be owned, managed and operated by […]

What Are the Best Domain Extensions for Cold Email?

Emails are more than just a means of workplace communication. They are also incredibly effective tools for outreach, but only if used properly. In this context, the domain extension can significantly influence your credibility and response rates. How Do Domain Extensions Affect Cold Emailing? Domain extensions like “.com” and “.io” are great due to their […]