Hello I want to show some other information of that users, like user's bio, Title
refer:
https://prnt.sc/qew7pp
thanks
This reply has been marked as private.
It didn't work for me, This is how it looks after placing this code
https://prnt.sc/qf6ulq
But i want it here
https://prnt.sc/qf6vlm
This reply has been marked as private.
This reply has been marked as private.
Hello,
actually this the correct code the only reason behind this issue is your template layout is different.
please try changing the layout from wp-admin >> appearance >> customize >> layout >> profile layout.
try this with another layout. it will work.
This reply has been marked as private.
Hello,
please paste this code in customizer plugin >> customizer.php
add_action('bp_profile_after_member_header_meta',function(){
if(!is_user_logged_in()){
return;
}else{
$user_id = bp_displayed_user_id();
$user = get_user_by('id',$user_id);
//get_currentuserinfo();
$field1 = 12;
$field2= 16;
echo "<span>User ID: " . $user->id . "</span></br>";
echo "<span>Username: " . $user->user_login . "</span></br>";
echo "<span>User email: " . $user->user_email . "</span></br>";
echo "<span>User first name: " . $user->user_firstname . "</span></br>";
echo "<span>User last name: " . $user->user_lastname . "</span></br>";
echo "<span>User display name: " . $user->display_name . "</span></br>";
echo "<span>Field 1: " . bp_get_profile_field_data( 'field='.$field1 .'&user_id=' . $user->id) . "</span></br>";
echo "<span>Field 2: " . bp_get_profile_field_data( 'field='.$field2 .'&user_id=' . $user->id) . "</span></br>";
}
},99);
refer: https://share.getcloudapp.com/OAuLG945
user profile field id to show the details as per your requirement.