Support » Plugin: Co-Authors Plus » Coauthor's avatar

  • Resolved Ever Calamaco

    (@ever-calamaco)


    Hey so I love the plugin! I want to see if there is a way to show the coauthors avatar when the coauthors link is clicked instead of the originals author’s avatar. This is the code for the single.php showing both authors:
    <?php if ( function_exists( ‘coauthors_posts_links’ ) ) {
    coauthors_posts_links();
    } else {
    the_author_posts_link();
    }; ?>

    This allows both names to show up. Great!!
    But once the coauthor link is pressed on the author.php the avatar that shows up is the original author. which is this code:
    <?php echo get_avatar($post->post_author); ?>

    Is there a code snippet I can replace this with that states if there is a coauthor avatar, show it, if not show gravatar?

    please help! Really need this to work.

    https://wordpress.org/plugins/co-authors-plus/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    If <?php echo get_avatar($post->post_author); ?> is in your author.php file, you might instead be able to use:

    <?php echo get_avatar( get_queried_object()->user_email ); ?>

    Your guest author will need an email address set in their profile, however.

    NICE!!! Works Great! Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Coauthor's avatar’ is closed to new replies.