Are you looking for a way to display a user @mention name directly below their avatar within a bbPress forum topic? While there’s probably a plugin for this, we have created a quick code snippet that you can use to add @mention username under bbPress user avatars.
Instructions:
All you have to do is add this code to your theme’s bp-custom.php file:
function wps_at_mention(){ echo '<span class="bbp-user-nicename"><span class="handle-sign">@</span>'. bp_core_get_username(bbp_get_reply_author_id(bbp_get_reply_id())) .'</span>' ; } add_action( 'bbp_theme_after_reply_author_details', 'wps_at_mention' );
Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.
If you liked this code snippet, please consider checking out our other articles on the site like: 9 best WordPress job board plugins and how to create a multi-page form in WordPress.
Awesome, it worked!
Thank you very much…