WordPress.org

Support

Support » Plugins and Hacks » Co-Authors Plus » [Resolved] After WP 3.5 new author does not show Gravatar or Bio

[Resolved] After WP 3.5 new author does not show Gravatar or Bio

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

    @danielbachhuber

    Can you share the code you’re using to append the Gravatar photo and bio?

    Sure!

    <!--Display Author Code -->
    <div class='author-shortcodes'>
    <div class='author-inner'>
    <?php if ( function_exists( 'coauthors_posts_links' ) ) { coauthors_posts_links(); } else { the_author_posts_link(); } ?>
    <?php $coauthors = get_coauthors(); ?>
    <?php foreach( $coauthors as $coauthor ): ?>
    <div class="authbio">
    <?php $userdata = get_userdata( $coauthor->ID ); ?>
    <div class='author-image'>
    <?php if (function_exists('get_avatar')) { echo get_avatar( $userdata->user_email, '57' ); } ?>
    			<div class='author-overlay'></div>
    		</div> <!-- .author-image -->
    <div class='author-info'>
    <p><?php if ( $userdata->user_description ) echo $userdata->user_description; ?></p>
    </div> <!-- .author-info -->
    </div>
    <?php endforeach; ?>
    </div> <!-- .author-inner -->
    </div> <!-- .author-shortcodes -->

    Thank you!

    Plugin Author Daniel Bachhuber

    @danielbachhuber

    Ok. Instead of:

    <?php $userdata = get_userdata( $coauthor->ID ); ?>

    You should do:

    <?php $userdata = $coauthor; ?>

    Good Morning Daniel!

    It fixed the Gravatar, but still not the bio. Same problem: old users have the bio published, but not the new ones like this: http://umamaedasarabias.com.br/2013/01/14/o-milagre/

    Anyways, thanks a lot for the quick reply.

    Plugin Author Daniel Bachhuber

    @danielbachhuber

    Oh. Instead of $userdata->user_description, try doing $userdata->description

    Daniel, it worked!! Many thanks!! =)

    one question on this subject! this is an amazing thing

    i would like to do the excact same thing and add more to the code

    a link to the authors profile where will be listed all the post he/she wrote instead of going to the website of the author

    and also if possible an excerpt of the bio in the code above instead of all the bio? because there might be authors with big bio

    Please help out! I will reward with a nice donation

    <?php foreach( get_coauthors() as $coauthor ) : ?>
    <div id=”authorinfo” class=”columns alpha omega marT30 marB20″>
    user_url; ?>”><?php echo get_avatar( $coauthor->user_email, ’80’ ); ?>
    <h5 class=”marB10″><?php _e(‘By’, ‘contempo’); ?>: user_url; ?>”><?php echo $coauthor->display_name; ?></h5>
    <p><?php echo $coauthor->description; ?></p>
    <div class=”clear”></div>
    </div>
    <?php endforeach; ?>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] After WP 3.5 new author does not show Gravatar or Bio’ is closed to new replies.
Skip to toolbar