Skip to:
Content
Pages
Categories
Search
Top
Bottom

Put user descripton under avatar in whos online


  • autox420
    Participant

    @autox420

    My current code that i have in whos online widget.
    <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></br><center><font size="2"><?php bp_member_name();?></font></center></a>

    I would like to add users description under the avatar or nickname.
    I think im using wrong code or doing something wrong.
    The code i have so far is this but it doesn work.
    <?php $user_meta = get_userdata(bp_displayed_user_id());echo($user_meta->description);?>

    Whats the correct code? Whats the correct way?

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

  • Boone Gorges
    Keymaster

    @boonebgorges

    Your problem is probably bp_displayed_user_id(). This returns the ID of the user whose profile you’re currently viewing – that is, example.com/members/username.

    Within a bp_has_members() loop, use bp_get_member_user_id() instead.


    autox420
    Participant

    @autox420

    Thanks it worked!


    Boone Gorges
    Keymaster

    @boonebgorges

    Excellent – thanks for reporting back!


    geertbaven
    Participant

    @geertbaven

    I am trying to use the code mentioned but I am just a beginner. Is it possible that you publish the entire snippet necessary to make this work? That would be very nice.

    Thanks in advance
    Geert

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