Support » Fixing WordPress » get_avatar not working

  • I am using a third party theme that, for some reason, does not have working avatars. The code seems simple but does not work for whatever reason.

    Is there anything upstream I can look for in code that may cause avatars to not work?

    I know this is a really generic question but I am not a themer or WordPress guru.

    This is the code that is trying to get the avatar for an author bio at the bottom of a post.

    <?php echo get_avatar( get_the_author_meta('email'), '70'); ?>

    Posted in another section of the forums but this section probably makes more sense. Sorry for the dupe.

Viewing 4 replies - 1 through 4 (of 4 total)
  • in my template file, it’s
    <?php echo get_avatar(get_the_author_meta('user_email')); ?>
    and works great.

    Just changed mine from ’email’ to ‘user_email’. Still no luck.

    I have three multisite installations with the exact same theme. get_avatar() works great in two of them, but shows nothing in the third.

    You can easily test if your code can find the correct email or user_id, by just doing echo get_the_author_meta(‘user_email’) etc.

    In my installation that is not the problem. There really seems to be something weird going on with get_avatar().

    Stuck as well. Anyone else have any ideas?

    I don’t see any error files on the server with more clues. get_avatar() works on other pages in the same installation.

    You might check in WP-admin -> Settings -> Discussion.

    Scroll to the bottom “Avatars” section. Under Avatar Display, make sure “Show Avatars” is selected.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘get_avatar not working’ is closed to new replies.