I have now inserted all of your code in functinos.php, but the only place the admin user disappear is at the “All users”-page. The admin user still shows up at the group members pages and the front page where I have listed all members with the Bowe code plugin.
Now the function is runned, but no fields are shown. My code is:
//Prints xProfile
function PrintKontaktinformationer() {
// we need the user_id first (mandatory outside a loop)
$user_id = bp_displayed_user_id();
// now we fetch the field data (separate field id's by comma)
$my_field = xprofile_get_field_data('10, 9, 1, 11, 12, 13, 14, 15', $user_id);
// we built the output
echo '<div class="authorinfo">TEST'. $my_field . '</div>';
}
// the new hook
add_action( 'show_PrintKontaktinformationer', 'PrintKontaktinformationer' );
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' );
I my functions.php and the last line in my template, but it doesn’t work. I get this error:
Fatal error: Call to undefined function bp_get_activity_user_id() in /data/home/nagcolle/public_html/designerspace.dk/ds/wp-content/themes/bp-mag-child/functions.php on line 17