Skip to:
Content
Pages
Categories
Search
Top
Bottom

Dispaly Nickname instead of username

  • Avatar of Nightstalker101
    nightstalker101
    Participant

    @nightstalker101

    At the moment I call the username with the following templatetag:

    <?php bp_the_site_member_name() ?>

    When I call it in this way, it displays the full name and not the Nick name (username).

    Is there any function, to call the user name?

    Lars

Viewing 5 replies - 26 through 30 (of 30 total)
  • Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Okay,

    Try this instead. Remember you’ll need to set the $member variable in your foreach:

    <a class="group-link" href="<?php bp_the_site_member_link() ?>"><?php echo bp_core_get_username( $member ); ?></a>

    Avatar of Nightstalker101
    nightstalker101
    Participant

    @nightstalker101

    …maybe a stupid questions from me. but:

    What do I have to set for $member?

    Lars

    Avatar of Nightstalker101
    nightstalker101
    Participant

    @nightstalker101

    I cannot find any foreach on the mebers loop, but I think, you mean the code after these lines

    <?php while ( bp_site_members() ) : bp_the_site_member(); ?>[code]
    till to the endif.
    Please let me knwo, what I have to set for $member.

    [code]<?php while ( bp_site_members() ) : bp_the_site_member(); ?>
    till to the endif.
    Please let me knwo, what I have to set for $member.

    [code]

    till to the endif.

    Please let me knwo, what I have to set for $member.

    Avatar of Nightstalker101
    nightstalker101
    Participant

    @nightstalker101

    I found a solution. Not the best but it works:

    The main problem began at the signup. I had the field “full name”. When this field is there, always the full name gets dispalyed, not the username. When I rename thsi field, the real name still gets diplayed instead of the username. When I remove the name of the field, better the label, I get only the username displayed. Jusr how I want it. Great.So I removed the name, gave the div class that includes the Full name box an id and removed it with css. What I do not like in my solution: I had to modify the core files…

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Nightstalker101-

    I\’m sorry that it has taken so long to reply to your question. I\’ve been on the road and have only had an hour here and there.

    What I do not like in my solution: I had to modify the core files…

    Well, as you know, it is never a good idea to modify core files. Have you tried using this:

    bp_the_site_member()

    in place of this:

    bp_the_site_member_name()

    I do not have the BP core files open right now so I’m just taking a guess here.

Viewing 5 replies - 26 through 30 (of 30 total)

The topic ‘Dispaly Nickname instead of username’ is closed to new replies.