Quantcast
Channel: BuddyPress.org » All Posts
Viewing all articles
Browse latest Browse all 321

Reply To: How do I display a single user’s avatar with just the username NOT user-id?

$
0
0

Assuming you have a Buddypress profile field for your users bio (in this case called ‘Description’), this will work.


function show_description ($atts) {

$user = get_user_by( 'login' , $atts['username'] );
	
$args = array(
     'field'   => 'Description',
     'user_id' => $user->ID
);

return bp_get_profile_field_data( $args );

}

add_shortcode( 'showdescription' , 'show_description' );

Viewing all articles
Browse latest Browse all 321

Trending Articles