I'm trying to figure out a simple way to display the user's avatar on their profile page. It seems like it would be a very simple thing to do, but I can't figure it out. Is get_avatar(); not the right way to display it?


You didn't add any code (make sure you add your own code next time because nobody bothers to help you if we have to guess the problem) but Im pretty sure I know what's wrong.

Straight out of the WordPress codex:

echo get_avatar( $user_id_or_email, $avatar_size, $default_avatar, $alt_text, $args );

You have to echo it because get_avatar() doesn't output it by default.

Also make sure that "Show Avatars" is checked in Settings because it will not return avatar otherwise.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.