Display the uploaded avatar

This topic contains 4 reply and 2 voices, and was last updated by Joakim-sb 10 years, 10 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
June 9, 2013 at 5:54 pm 4705
Joakim-sb Hello, Thanks for a great plugin. I have a question about avatars in this plugin. I have a registration form so that users can edit their profile, which works fine. In this form I'm using the avatar profile field so that the user can upload an avatar. But how do I display the uploaded avatar? I know that Wordpress uses gravatars by default when I use get_avatar(), but i don't want to display gravatars, I want to display the uploaded avatar. Is this possible? How does this avatar upload actually work? Help would be much appreciated.
June 9, 2013 at 8:21 pm 4714
Tareq Hasan Tareq Hasan

Hi,

WP User Frontend uses the same get_avatar function for showing the avatar image. If you use the get_avatar function, it’ll search for any uploaded image through the plugin. If not, it’ll show the default gravatar instead.

June 9, 2013 at 8:38 pm 4716
Joakim-sb Joakim-sb

Hi Tareq,

Thanks for answering. That’s the problem, I am using the get_avatar() function in my author.php file, but it won’t display the uploaded image. Instead it displays a gravatar, or the “mystery man” image which you can select in the admin dashboard.

However, up in the admin bar where it says “Howdy, …”, my uploaded image is actually displayed. Why is it not working in my author.php file? Have I missed something perhaps? Do I need to add something in the function, like an ID or something else?

June 9, 2013 at 8:53 pm 4718
Tareq Hasan Tareq Hasan

As the howdy area looks as expected, then everything looks fine. May be you should pass the user id or the user email in the get_avatar function and see if it works.

June 9, 2013 at 9:16 pm 4719
Joakim-sb Joakim-sb

Hi again Tareq,

I managed to fix it, simply by putting the user id inside the get_avatar() function, like this; get_avatar( $curauth->id );

Thanks for helping!

Viewing 4 Posts - 1 through 4 (of 4 total)