WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] Adding co-authors Bio, Avatar & Link (7 posts)

  1. andrewgable
    Member
    Posted 1 year ago #

    So I would like to have two author "blocks" of information, I'm having trouble calling the second author's information. Here is a photo of what one author "block" would look like. Image. Here is the PHP file assosiated with my template Code.

    How would you call to get the second authors photo, bio, and link to their page in that nice div?

    Thanks for the help.

    My WordPress Site

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

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    You'll need something like this instead:

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

    Hope this helps.

  3. andrewgable
    Member
    Posted 1 year ago #

    Sweet! A for loop in PHP, didn't know I could do that! Thanks for the help. One last little part, this guy. Code. Would I just have an something like Code 2? Because it just does not seem to be pulling the link correctly, You cannot "Click" it. Test Page

    Thanks!

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    That looks like a CSS issue. Your marT30 div is on top of the author bios.

  5. andrewgable
    Member
    Posted 1 year ago #

    Ahh yes, thanks for your help. Love the plugin!

  6. nemanja.radevic
    Member
    Posted 1 year ago #

    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

  7. nemanja.radevic
    Member
    Posted 1 year ago #

    so basically the coauthor->description; to be excerpt with lets say 200 characters

    and the coauthor->user_url;

    to be coauthors_posts_links

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic