I am working on user registration page. When user upload the image then I attached that image in user meta by attachment id
, now when user add the comment then his uploaded photo is not appearing in comment list beside his comment. After some search I got some information in avatar...but cant get any idea about how to upload avatar from front side?
Asked
Active
Viewed 2,623 times
0

Deep Kakkar
- 5,831
- 4
- 39
- 75

vrajesh
- 2,935
- 3
- 25
- 40
1 Answers
0
<?php
if ( function_exists( 'get_avatar' ) ) {
echo get_avatar( $user->user_email, 50);
} else {
//alternate gravatar code for < 2.5
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=
" . md5($user->user_email) . "&default=" . urlencode($default) . "&size=" . $size;
echo "<img src='$grav_url' height='50px' width='50px' />";
}
?>
Please check with this code. This should work.

Deep Kakkar
- 5,831
- 4
- 39
- 75
-
thx for your response but i am confused in varialbe that you write in function...means what is $comment in get_avatar? – vrajesh Jun 05 '15 at 04:40
-
is there any plugins so that i can set user avatar by givin user profile picture id(attachement id)? – vrajesh Jun 05 '15 at 05:09
-
user_email, 50 ); ?> must echo it. – Deep Kakkar Jun 05 '15 at 05:42