• Hi there,
    I need some help with your plugin. I am trying to get the Avatar image for the co author through php. I know how to get the Avatar image for the normal authors but not the ones added through the co-author plugin.

    The code I use to get the author avatar is :

    <?php echo get_avatar_url( get_the_author_meta('user_email')); ?>

    Now all I need is how to call the co-author avatar. How would I go about this?

    I would appreciate any help or guidance.
    Thanks in advance.

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

Viewing 1 replies (of 1 total)
  • intentionallywidenberg

    (@intentionallywidenberg)

    Use the optional ID argument to the get_the_author_meta() function:

    $coauthors = get_coauthors();
     foreach( $coauthors as $coauthor ) {
    	$user_id = $coauthor->ID;
            get_avatar( get_the_author_meta( 'user_email', $user_id ) )
    /// more code here
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Co-Author Avatars – An educated question :)’ is closed to new replies.