BUDDYBOSS WEB

Your community, courses and memberships on your own website.

BUDDYBOSS APP

Your own branded app on iOS and Android.

DONE FOR YOU

We build, launch and run it for you.

BuddyBoss website and mobile app

Web + App Done For You

$4,999 flat

Web Scale + Done For You Web

App Launch + Done For You App

PRICING

Web Pricing

Launch, Scale and Done For You Web.

From

$199

first year

App Pricing

Solo, Launch and Done For You App.

From

$499

first year

SITE + APP

Web + App Done For You

Your site and your app, built and run for you.

$4,999

flat, never rises

How to Create a Username Shortcode on BuddyBoss

Updated

Introduction

By default, BuddyBoss does not provide a shortcode to display the current user’s username. You can add a custom shortcode to show the username using a small function in your active theme. This guide explains how you can create a username shortcode.

Custom Workaround

Before proceeding, make sure you have a complete site backup.

  1. In your WordPress admin dashboard, go to Appearance > Theme Editor.
  2. Under Select theme to edit, choose your active theme (preferably BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, click Theme Functions (functions.php).
  4. Paste the following code just before the closing PHP tag (?>):
// Add [bb-print-username] shortcode

function bb_print_username() {

    ob_start();

    $user = wp_get_current_user();

    echo $user->user_nicename;

    return ob_get_clean();

}

add_shortcode( 'bb-print-username', 'bb_print_username' );
  1. Click Update File to save your changes.

Note: Any modifications like this are considered custom work. Please review the BuddyBoss Support Policy.

Troubleshooting and FAQs

Q: The shortcode is not showing the username, what should I check?
A: Make sure you are logged in and the code is added to the active theme’s functions.php.

Q: Can I display a different user field instead of the nicename?
A: Yes, you can replace $user->user_nicename with other WP user properties like $user->user_login or $user->display_name.

Q: Will this shortcode work anywhere on the site?
A: Yes, it can be used in posts, pages, or widgets that support shortcodes.

Q: Can I revert this change easily?
A: Yes, remove the code from functions.php and save.

Q: Who can I contact for further assistance?
A: Check the BuddyBoss Support Policy or consult a developer.

Was this article helpful?

Subscribe to Our Newsletter

This field is for validation purposes and should be left unchanged.
This field is hidden when viewing the form

Can’t find the answer you’re looking for?

Our support team is here to help with anything the docs don’t cover.