Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Display single xprofile fields


Tom
Participant

@jeffreeeeey

Threads been quite helpful for me so far..

I’m using Jet random members widget on the ‘members’ page and I’ve managed to get one of my profile fields to display there now, rather than a random field.

Here’s what I done…

In /directories/members/index.php find-

<?php bp_the_site_member_random_profile_data() ?>

and replace with-

<?php echo bp_custom_get_member_list_xprofile_data('Gender') ?>

where “Gender” is the name of the field you wish to display.

Then in bp-custom.php (in your plugins folder), add this:

//To add custom profile fiels to random members widget //
function custom_xprofile( $field ) {
echo bp_custom_get_member_list_xprofile_data( $field );
}
function bp_custom_get_member_list_xprofile_data( $field ) {
global $site_members_template;
return xprofile_get_field_data( $field, $site_members_template->member->id );
}

I’m working on a few other tweaks now to try adding this custom field to the actual member listing part of the page now and I imagine it will work in the same sort of way. I’ll keep you posted.

Skip to toolbar