Skip to:
Content
Pages
Categories
Search
Top
Bottom

Replacing Activity Status with xProfiles field data


  • mairaj
    Participant

    @mairaj

    Every BuddyPress profile shows activity status next to ‘Avatar Image’ like ‘active 4 hours, 26 minutes ago’. This status is also shown at the member’s directory page and on the search return page.

    I have a BP site where my members are models and talent. Agencies search for them with the criteria like Age, Height, Hair Color etc.

    Is it possible to show a few xprofiles data or excerpts in place of the activity status? What I want is to change:

    active 4 hours, 26 minutes ago

    to something like

    Height - 5'8", Hair Color - Black, Age - 25

    Any possibilities???

    Thank you for your guidance and support :)

Viewing 1 replies (of 1 total)
  • To display extended profile fields in the members directory, it’s easiest to add a function to your theme’s functions.php file. My theme is based on the bp-default theme, so in my file /wp-content/themes/theme-name/members/members-loop.php, there’s this action at the end of each member’s entry that we can hook into:

    Open up your functions.php file and add something like this:

    function add_member_custom_extended_profile() {
    if ( $xprofile_tele = bp_get_member_profile_data( 'field=Telephone' ) ) {
    echo 'Telephone:' . $xprofile_tele . '
    ';
    }
    }
    add_action('bp_directory_members_item', 'add_member_custom_extended_profile'); 

    You can get the exact field name to use by looking at a member’s profile page and copying the text in the left-most column.

    I originally got this idea from here: http://premium.wpmudev.org/forums/topic/bp-add-profile-field-data-to-members-directory-with-links

Viewing 1 replies (of 1 total)
  • The topic ‘Replacing Activity Status with xProfiles field data’ is closed to new replies.
Skip to toolbar