Skip to:
Content
Pages
Categories
Search
Top
Bottom

user description in member list (fixed)


  • autox420
    Participant

    @autox420

    I would like to display users description by his avatar in the member list.
    How to?

    $user_meta = get_userdata(bp_displayed_user_id());
    echo($user_meta->description);
Viewing 2 replies - 1 through 2 (of 2 total)

  • shanebp
    Moderator

    @shanebp

    Create a template overload of this file: buddypress\bp-templates\bp-legacy\buddypress\members\members-loop.php

    And place your code wherever you want in the overload.

    bp_displayed_user_id() is incorrect in the context of the members loop.
    Instead:

    $user_meta = get_userdata(bp_get_member_user_id());
    echo($user_meta->description);

    Or instead of an overload, use this hook: do_action( 'bp_directory_members_item' );


    autox420
    Participant

    @autox420

    Well i tryied to play around with the codes you provided thanks.

    The easiest solution i found was this.

    members-loop.php
    Change this.
    <div class="item-meta"><span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_member_last_active( array( 'relative' => false ) ) ); ?>"><?php bp_member_last_active(); ?></span></div>

    To this.
    <div class="item-meta"><?php $user_meta = get_userdata(bp_get_member_user_id()); echo($user_meta->description); ?></span></div>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘user description in member list (fixed)’ is closed to new replies.
Skip to toolbar