Support » Themes and Templates » Add Gravatars For The Post Author

  • Resolved instructa


    I’m making an authors.php and I want to add the authors avatar in the authors info I’ve created. I can call their name, bio info, post count, everything except their avatar. I,ve tried everything I can find like `<?php
    echo get_avatar( $id_or_email, $size = ’96’, $default = ‘<path_to_url>’ );
    ?>` But nothing seems to work. See my author page here author/alicecan

Viewing 4 replies - 1 through 4 (of 4 total)
  • Looking at the html you have output would suggest the $id_or_email has not been populated, or show avatars is set to no in your admin/settings/discussion.

    Otherwise the code

    <?php echo get_avatar( get_the_author_meta('ID'), 64 ); ?>

    should work fine.


    No that does not work
    <?php echo get_avatar( get_the_author_meta('ID'), 64 ); ?>
    That shows the mystery man, which is not even my default avatar.
    By the by, Avatar Display, Show Avatars, radio box is checked, so set to true.
    Thanks for the try but, any other ideas?

    Can you post the code you’re actually using?

    Solved with this
    <?php echo get_avatar( $curauth->user_email, $size = '64', $default = '<path_to_url>' ); ?>

    Thank You Adam

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add Gravatars For The Post Author’ is closed to new replies.