Up to 50 percent off

Avatar Questions

This topic contains 2 reply and 2 voices, and was last updated by cphine 11 years, 3 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
August 1, 2013 at 6:02 pm 6559
cphine Hello. I just bought the pro version of wp-user-frontend to replace my use of the free version and wp-user-avatar. (I'm also using theme-my-login) The avatar program would not work from the frontend so I figured this would solve the issue. Wow. I didn't realize how much work was in store for me! This is the first series of what will probably be a number of questions. Apologies in advance. First, when logged in as the administrator and in the backend, I am unable to change or add a user avatar. My site has a number of Guest authors that don't post themselves, but allow us to use their content. I would like to be able to update their avatar, as I could with wp-user-avatar. Is this not possible? Could it be? Second, with wp-user-avatar, I was able to use this code <?php echo get_wp_user_avatar($user_id, 50, 'left'); ?> to display the avatar both in the author archive page and next to their post on my front page. Now, with the pro version, I am trying to use this code <?php echo get_avatar( $curauth->user_id, '50' ); ?> It works in my author archive, but it does not work on my front page. I only get the gravatar "mystery man" image. Any thoughts as to why? EDIT: Figured out the code for the front page. (I don't understand it, but it appears to work) I'll leave this hear just in case anyone else is wondering. <?php echo get_avatar( get_the_author_meta( 'ID' ), 50 ); ?>
August 1, 2013 at 7:53 pm 6568
Tareq Hasan Tareq Hasan

I think, the avatar in backend profile will not work if you update on behalf of another user. Because it associate the avatar with the current logged in user. In this case, you can use the User Switching plugin to switch to that user, update the profile and switch back!

get_avatar( $curauth->user_id, '50' ); works in author archive because your author.php is getting the current authors archive to the $curauth variable. But in other pages this won’t work, because $curauth variable is unknown in the context. get_the_author_meta( 'ID' ) will work on the WordPress loop correctly because WordPress sets the global $post variable that way.

August 15, 2013 at 11:22 am 6981
cphine cphine

Ok, user switching plugin does work, but it’s weird that as the admin I can’t edit the avatar but I can change everything else about them…name, password, bio, etc. I thought that was the point of being the Admin! Using other avatar programs, I could edit as admin. Perhaps something to consider.

Thanks for the description of the $curauth code. I think I understand. Got it to work, that’s what I’m concerned about!

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