Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [Resolved] Display xProfile field groups

@danbp

Participant

hi @pstidsen,

not sure i understand what you want. But if your goal is to fetch a xprofile data and show it somewhere on your site (aka outside of the profile loop), you can use a function like these:

function pstidsen() {
         // we need the user_id first (mandatory outside a loop)
	$user_id = bp_get_activity_user_id();
        // now we fetch the field data (separate fied id's by comma)
	$my_field = xprofile_get_field_data('4, 41,55', $user_id);
	// we built the output
	echo '<div class="authorinfo">'. $my_field . '</div>';
	
}
// the new hook
add_action( 'show_pstidsen', 'pstidsen' );
// finally add this placeholder in the appropriate template
<?php do_action( 'show_pstidsen'); ?> 
Skip to toolbar