How to Highlight Author’s Comments in WordPress
Вставка
- Опубліковано 11 вер 2024
- 🖌️ Want to make your comments stand out on your WordPress site? In this tutorial, we’ll show you step-by-step how to highlight the author’s comments so they grab attention instantly! Whether you're running a blog, forum, or business website, highlighting your comments can help your audience easily identify the author’s voice.
🔍 In this video, you’ll learn:
Why highlighting author comments is important.
How to customize comment styles in WordPress.
Adding custom CSS to distinguish your comments.
Best practices for comment management.
🎨 No coding skills? No problem! We'll guide you through every step, making it simple and easy to follow. Elevate your site’s user experience and give your readers a better way to engage with your content.
🔗 Useful Links:
visualmodo.com...
visualmodo.com...
👍 Don’t forget to like, share, and subscribe for more WordPress tips and tricks! Hit the notification bell 🔔 to stay updated with our latest content.
#WordPress #BloggingTips #WebsiteDesign #WebDevelopment #WordPressTutorial
⭐ Find Best Professional Freelance Services www.fiverr.com/...
⭐ Buy Website Hosting Plan and Gain a Free Domain At bluehost.sjv.i...
⭐ Best VPN Service namecheap.pxf....
⭐ Register Your Domains Hassle-Free namecheap.pxf....
⭐ Managed Cloud Hosting www.cloudways....
I hope you guys enjoy this video, feel free to use the comments section below in case you have any questions, and don't forget to check out that Visualmodo website and subscribe to our channel for more web design and development training videos. Please check the links below for more content.
Website visualmodo.com/
Grow your site on growwwth.net/
Facebook / visualmodo
Instagram / visualmodo
Twitter / visualmodo
⭐ Find Best Professional Freelance Services www.fiverr.com/s2/1ad9497d86
⭐ Buy Website Hosting Plan and Gain a Free Domain At bluehost.sjv.io/EaMeRe
⭐ Best VPN Service namecheap.pxf.io/XYx5q3
⭐ Register Your Domains Hassle-Free namecheap.pxf.io/rnmrdB
⭐ Managed Cloud Hosting www.cloudways.com/en/?id=309377
Really Good!
Glad you think so!
TOP!
Thank you so much for your comment!
if ( ! class_exists( 'WPB_Comment_Author_Role_Label' ) ) :
class WPB_Comment_Author_Role_Label {
public function __construct() {
add_filter( 'get_comment_author', array( $this, 'wpb_get_comment_author_role' ), 10, 3 );
add_filter( 'get_comment_author_link', array( $this, 'wpb_comment_author_role' ) );
}
// Get comment author role
function wpb_get_comment_author_role($author, $comment_id, $comment) {
$authoremail = get_comment_author_email( $comment);
// Check if user is registered
if (email_exists($authoremail)) {
$commet_user_role = get_user_by( 'email', $authoremail );
$comment_user_role = $commet_user_role->roles[0];
// HTML output to add next to comment author name
$this->comment_user_role = ' ' . ucfirst($comment_user_role) . '';
} else {
$this->comment_user_role = '';
}
return $author;
}
// Display comment author
function wpb_comment_author_role($author) {
return $author .= $this->comment_user_role;
}
}
new WPB_Comment_Author_Role_Label;
endif;
🎉🎉🎉🎉🎉❤❤
Thank you so much for your comment!