bp_get_profile_field_data( array(‘user_id’=>$user_id,’field’=>$field ));
Thanks Modernlooper. I’m using “ to link back to the users profile from outside of members. However, I am not sure with your code how to connect the field with the post author’s user id.
Any ideas?
Use:
bp_displayed_user_id
bp_loggedin_user_id
Or you use the WP post author id if you want to show profile data on post or bbPress topics.
This really needs a function with logic. Example, bp_user_id() could give you id based on content.
Thanks so much for the reply.
When I manually add a user id I get the result I want:
`echo xprofile_get_field_data(‘About you’, ‘2’);`
However, when I try and use the options you provided above, it comes up blank. Is there something wrong with my implementation:
`echo xprofile_get_field_data(‘About you’, ‘bp_displayed_user_id ()’)`
or
`echo xprofile_get_field_data(‘About you’, ‘bp_user_id ()’)`
Thanks,
Ian
`Try this`
`$current_user = wp_get_current_user();
$current_user_id = $current_user->ID;
bp_profile_field_data( array('user_id'=>$current_user_id,'field'=>'About me' ));
`
Thanks – that works for showing the current logged in user’s data – that’s a breakthrough!
What I need to show though is the author of the post’s id – is that achievable?
`query_posts($query_string . ‘&author=’. $user_id);`
Thanks @chouf1 and excuse my ignorance, but where do I add
`query_posts($query_string . ‘&author=’. $user_id);`
to
` $current_user = wp_get_current_user();
$current_user_id = $current_user->ID;
bp_profile_field_data( array(‘user_id’=>$current_user_id,’field’=>’About me’ ));`
Can anyone help with the above? Cheers