WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Add Gravatars For The Post Author (5 posts)

  1. instructa
    Member
    Posted 2 years ago #

    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

  2. Adam
    Member
    Posted 2 years ago #

    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.

    Regards

  3. instructa
    Member
    Posted 2 years ago #

    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?

  4. Adam
    Member
    Posted 2 years ago #

    Can you post the code you're actually using?

  5. instructa
    Member
    Posted 2 years ago #

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

    Thank You Adam

Topic Closed

This topic has been closed to new replies.

About this Topic