WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] Featured image (instead of gravatar) (6 posts)

  1. notkristina
    Member
    Posted 1 year ago #

    Guest authors' featured images aren't displaying on my site, only gravatars.

    Weirder still, whenever I try to display a guest author's info elsewhere on the site (specifically in some widgets I'm building), it isn't even pulling the gravatar—it's automatically resorting to the not-pictured default image.

    Has anyone had either or both of these problems before? I would love to be able to get the correct pictures to show up.

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    What code are you using to display the guest author's avatar? You'll need to be using get_avatar() with their email address, and then the guest author needs to have an email address associated with it.

  3. notkristina
    Member
    Posted 1 year ago #

    I was foolishly using the user ID instead of the email, so thanks—that gets me the gravatar. Any ideas about how to get the guest author's featured image instead?

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Does your guest author have an assigned email address?

  5. notkristina
    Member
    Posted 1 year ago #

    Yes. I've now bypassed this problem by pulling the featured image directly instead of the avatar, since I don't want to use the gravatar ever. In case it helps anyone else, this is what I'm using:

    //ONLY show an image if there IS a featured image.
    if ( has_post_thumbnail( get_the_author_meta('ID') ) ){
     ?>
    
     <div class="avatar" style="float:left; margin-right: 10px"><?php echo get_the_post_thumbnail( get_the_author_meta('ID'),array(90,90) ); ?> </div>
    
    <?php  } ?>
  6. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Thanks, notkristina. That seems like a reasonable solution for now. I'll see if we can come up with something better in the future.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic