Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Display xprofile field in blog post?


peterverkooijen
Participant

@peterverkooijen

We were discussing displaying single xprofile fields here.

Someone gave me this function:

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 );
}

So you can use this in the members index.php:

<p><?php custom_xprofile('Company') ?></p>

But it only works in members_template. I’d like to have a function for xprofile fields that works anywhere…

Haven’t had time to try variations on this one. Suggestions very welcome!

@Anton Koekemoer, I’m pretty sure the key would be in replacing $site_members_template in the function, but I wouldn’t know with what.

EDIT2: Here’s the thread where I originally got the function, from John James Jacoby.

Skip to toolbar