Add this code to your theme’s functions.php file:
function wpu_user_avatars($name, $user) {
if ( !$user->user_id )
return $name;
$url = get_author_posts_url($user->user_id);
$avatar = get_avatar($user->user_id, 32);
return html("a href='$url' title='$user->user_name'", $avatar);
}
add_filter('useronline_display_user', 'wpu_user_avatars', 10, 2);
Replace 32 with whatever size you want.
Is there a way to display both? User avatar then name?
Yep. In the above code, replace:
return html("a href='$url' title='$user->user_name'", $avatar);
with
return html("a href='$url' title='$user->user_name'", $avatar) . $name;
Where is the comma being added between user names (or in my case now, avatars)?
I need to take it out but can’t find where to.
Thanks,
Wade
See Separators in Settings -> UserOnline.
It works in normal wp. In WPMU its shows the blogs author url. How do i linked to main blog author slug. Thanks in advance!
Global Tamil
Hello,
Thank you for codes, which(who) works tres indeed, thank you,
The possibility t-il there in removing(kidnapping) ” USER: ” which(who) is in front of the adversity
I would like to have a list with the adversities and the name down
Thank you has you