Tagged: buddypress avatar
Hi JJ,
You can usebp_core_get_user_domain( $user_id );
to get the url of the user.
Here is an example.
<a href="<?php echo bp_core_get_user_domain(1);?>">....</a>
Hope this helps.
Regards
BrajeshUnfortunately, it only shoots back a URL link (that isn’t clickable).
The actual code piece is this:
foreach ($bookmarked_by as $user) { $avt_list .= get_avatar($user , 30); }
While it belongs to this:
add_filter( 'the_content', 'wp_bookmark_below_post', 1001 ); function wp_bookmark_below_post( $content ) { $post_id = get_the_ID(); $post = get_post( $post_id ); if($post->post_type=='page'){ return $content; } if(wpb_get_option('wpb_show_users_avatar')) { $avt_list = ''; $bookmarked_by = get_post_meta($post_id , 'wpb_bookmarked_by' ,true); if($bookmarked_by == '') $bookmarked_by = array(); $bookmarked_by = array_unique($bookmarked_by); foreach ($bookmarked_by as $user) { $avt_list .= get_avatar($user , 30); } return $content.'<style>.bookmarked-avatar img{margin: 3px;}</style><div class="bookmarked-avatar"><h5>Bookmarked By Members</h5>'.$avt_list; } return $content; }
Any other suggestion would be sincerely appreciated.
Just trying to make avatar that is displayed clickable to the user profile page.
Thank you.
Hi,
You will need to change this line$avt_list .= get_avatar($user , 30);
to
$avt_list .= '<a href="' . bp_core_get_user_domain( $user ) . '">' . get_avatar( $user, 30 ) . '</a>';
Hope that helps.
Regards
Brajesh
Viewing 6 posts - 1 through 6 (of 6 total)
The topic ‘ [Resolved] Get avatar with link to profile’ is closed to new replies.
This topic is: resolved