WordPress.org

Ready to get started?Download WordPress

Forums

get_avatar not working (5 posts)

  1. sandbarmark
    Member
    Posted 2 years ago #

    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.

  2. SNSD Photo
    Member
    Posted 2 years ago #

    in my template file, it's
    <?php echo get_avatar(get_the_author_meta('user_email')); ?>
    and works great.

  3. sandbarmark
    Member
    Posted 2 years ago #

    Just changed mine from 'email' to 'user_email'. Still no luck.

  4. modifiedcontent
    Member
    Posted 2 years ago #

    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.

  5. jefffassnacht
    Member
    Posted 1 year ago #

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

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

Topic Closed

This topic has been closed to new replies.

About this Topic