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”]
if($comment->user_id == $post->post_author) {
$class = ‘comment-author’;
} else {
$class = ‘comment’;
}
?>



[/sourcecode]

You May Also Like

Interview With Entrepreneur & SEO Locale’s COO, Nick Quirk

1- Hello Nick, can you please tell us a bit about you? Well, my name is Nick Quirk, I’ve been doing digital marketing since the early 2000s. I found my niche when I owned my own business back in the early 2000s of developing websites and offering online marketing to clients. After 10 years in […]

How To Reach Your Customers In 2024

Understanding the Importance of Diversified Content Understanding how to reach your customers in 2024 is integral to the success of any business. In today’s ever-evolving digital landscape, companies must diversify their content strategies to capture a broad audience. This means looking beyond traditional marketing methods and embracing innovative approaches. According to a 2029 forecast by […]

Making It Work: Tackling Complicated Relationships With Your Family

Part of parenting means managing complicated relationships with your family. From lowering stress and accepting responsibility, to working with a therapist and being patient enough to hear your family members out, your parenting isn’t limited to keeping everyone happy. If your relationships with family members are less than ideal, approach the relationships by following these […]

Redesigning your Website? Here’s how to Handle Duplicate Content

Are you planning to redesign your website to get better search engine rankings? One of the most common issues that you may have to handle and find solutions is duplicate content. The commonly occurring issues of duplicity in the content are bound to raise issues and cause fundamental errors in your newly designed website. Given […]