Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to get username?

Viewing 6 replies - 1 through 6 (of 6 total)

  • PinkishHue
    Participant

    @pinkishhue

    Try <?php bp_displayed_user_username(); ?>


    binary10
    Participant

    @binary10

    Thanks that works


    topherjamesknoll
    Participant

    @topherjamessf

    Hi there,

    This doesn’t work for me. I’m building a theme from scratch and I think it’s just ’cause I haven’t included something. Do you know what that might be? Does a separate theme need to call something from the BuddyPress plugin?


    shanebp
    Moderator

    @shanebp

    bp_displayed_user_username() only works on a BP profile page.

    Try:

    echo bp_core_get_user_displayname( bp_loggedin_user_id() );

    or

    echo bp_core_get_username( bp_loggedin_user_id() );


    topherjamesknoll
    Participant

    @topherjamessf

    Bwa! I’m so dumb. I haven’t been using echo. LOL!

    So, I’m still curious. What would constitute a BP profile page? Right now I just have pages like index.php and page.php in the theme I’m building.

    Also, THANKS!!!


    shanebp
    Moderator

    @shanebp

    >What would constitute a BP profile page?

    Any page specific to a user, usually with an url like: .../members/topher/some-tab

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar