Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to display the username, not the fullname


  • 4274483
    Inactive

    I’m trying to display the username at the top of the profile page:

    <h1 class="fn"><a href="<?php bp_user_link() ?>"><?php bp_user_fullname() ?></a></h1>

    I do not want to show the fullname, but the username.

    Could anyone tell me the tag I need to use instead of <?php bp_user_fullname() ?>

    (running BuddyPress 1.0.1)

    Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • I can’t answer this whilst I’m at work, but I do recommend that you update your BP to the latest version ASAP. WordPress has itself been hit by a vulnerability in the last week which affects all but the latest version of the software.

    The same idea applies to BudyPress too – upgrade frequently.


    Chad Holden
    Participant

    @holdench

    I was wondering about this as well. i want to use more of the user fields. I also want to make things like a file upload field since I have users who want to upload collective agreement pdfs and the like. Also, there should be an option for a email field type and url fieldtype.


    4274483
    Inactive

    Ok, I have update my scripts… now running WordPress MU 2.8.4. & BuddyPress 1.0.3.

    I have also managed to change the fullname for the username by adding a filter to bp_user_fullname. But it only works for the profile page. I was hoping to change all the fullname for the username throughout the site. (I find the original bp fullname Vs username system to be very confusing)

    Any Suggestions?


    gerikg
    Participant

    @gerikg

    I put this together, it works but I don’t know if this is the best way to do it. (I don’t know PHP)

    <?php global $user_ID, $user_identity; get_currentuserinfo();?>

    <?php $user_info = get_userdata($user_ID);echo $user_info->user_login; ?>

    it works on my site.


    Chad Holden
    Participant

    @holdench

    Anyone? I can see it’s possible by the user pages on this site, it lists that I am a developer under my avatar. How do I use this information that people enter, say in the Members Directory?


    gerikg
    Participant

    @gerikg

    sorry i posted the wrong code.

    try this:

    <?php global $bp; $ud = get_userdata( $bp->displayed_user->id );?><?php echo $ud->user_login; ?>


    Chad Holden
    Participant

    @holdench

    @gerikg: Was this towards my post or towards the original one?


    gerikg
    Participant

    @gerikg

    The original by catagirl


    gerikg
    Participant

    @gerikg

    Chad honestly I don’t understand what you are asking. If you can elaborate I can search for something that might work for you. (I don’t know php but I’m good at searching)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to display the username, not the fullname’ is closed to new replies.
Skip to toolbar