How To Show BuddyPress Profile Fields In Member’s Header Area ?

You can show additional profile info(other than @username)  in BuddyPress member’s profile header area.

Following function does this for you. Add it in your theme’s function.php file or bp-custom.php file:

function extra_profile_fields_output(){
global $bp;
$field_text = bp_get_profile_field_data( ‘field=Mobile’ ) );
echo ‘<span class=”profile-fields”>’ .$field_text. ‘</span>’;
add_action( ‘bp_profile_header_meta’, ‘extra_profile_fields_output’ );

Remember to change field= to the field you want to display.

In the above function field=Mobile is there so here you will need to change ‘Mobile’ to the name of profile field you like to display.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.