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

AI-Powered CRM: How HubSpot’s Smart Features Beat Competitors

Intelligent automation eliminates CRM guesswork when HubSpot’s AI-powered features predict customer behavior and optimize sales processes automatically. While competitors like Salesforce and Pipedrive charge extra for basic AI add-ons, HubSpot’s platform integrates AI natively. The difference shows immediately in both conversion rates and sales velocity. Businesses using generative AI in their CRM are 83% more […]

How to Find Profitable Niches with Jungle Scout’s Niche Research Tools

Are you eager to step into the dynamic world of Amazon selling, or perhaps you’re already an established seller looking to expand your product line and maximize your profits? In the fast-paced e-commerce arena, finding the right niche is akin to striking gold. It’s where your entrepreneurial journey begins and where Jungle Scout’s Niche Research […]

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 […]

Advowire making money with social media assest has never been easier

Advowire is a new service started just nine months ago and it’s gaining authority in the social media market quickly. So what is Advowire ? It’s a social media market where everyone can find people to share his content easily in many social website. Also everyone can make money with Advowire if he has a social account. […]