WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] Create A Separate Co-Author Section (15 posts)

  1. guitargeek_com
    Member
    Posted 2 years ago #

    Hello Daniel,

    Great Plugin! I'm hoping that you can shed some light on creating a separate DIV section for the Co-Author that will only appear when a second (or third) Contributor is attached to the post.

    Here's my code for the Main Author on my posts:

    // <!-- About The Main Author -->
    <div class="dash"></div>
    <div class="author">
    <h3>About the Author</h3>
    <?php echo get_avatar( get_the_author_email(), '80' ); ?><p>
    <?php the_author_meta('user_description'); ?></p></div>
    <!-- //About The Main Author --> //

    Here's the identical section that will appear below the Main Author - It will only appear when a post with a second (or third) contributor appears. I only want to Contributor to appear in this section when applicable.

    What do I need to change in the code below to get this working with Co-Authors?

    // <!-- About The Contributor -->
    <div class="dash"></div>
    <div class="author">
    <h3>About the Contributor</h3>
    <?php echo get_avatar( get_the_author_email(), '80' ); ?><p>
    <?php the_author_meta('user_description'); ?></p></div>
    <!-- //About The Main Contributor --> //

    I don't see a Co-Author template tag that replaces either the get_the_author_email and the_author_meta (assuming that's what I need to replace)

    Any help appreciated!

    Adam

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

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Still looking for help on this?

  3. guitargeek_com
    Member
    Posted 2 years ago #

    Hey Daniel,

    Yes, I'm still looking for some help on this one.

    Thanks!

    Adam

  4. guitargeek_com
    Member
    Posted 2 years ago #

    That would be great! Thanks!

  5. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Sorry, here's the proper link. Hope it helps

  6. guitargeek_com
    Member
    Posted 2 years ago #

    Daniel,

    Sent you a note regarding this post.

    Would love to get this working.

    Adam

  7. guitargeek_com
    Member
    Posted 2 years ago #

    Hello Daniel,

    We shot a some emails back and forth via the WordPress Forums about adding a separate DIV section for a Co-Author a few months ago. You ended up posted some code on your blog here: http://danielbachhuber.com/2012/01/22/show-biographies-for-co-authors-at-the-end-of-your-post/

    I tried valiantly to get this working but still need some advice and/or help.

    Example of a single author post that I'd like to add a co-author div section to: http://www.guitargeek.com/jimi-hendrix-woodstock-1969-guitar-rig-and-gear-setup-diagram/

  8. guitargeek_com
    Member
    Posted 2 years ago #

    Here's my WP code for the main author - which always appears in posts:

    <!-- About The Author -->
    			<div class="dash"></div>
    			<div class="author">
    			<h3>About the Illustrator</h3>
    				<?php echo get_avatar( get_the_author_email(), '80' ); ?>
    			<p><?php the_author_meta('user_description'); ?></p>
    			</div>
    <!-- //About The Author -->
  9. guitargeek_com
    Member
    Posted 2 years ago #

    And the section (including DIV) I'd like to appear only when an
    additional author is added...

    <!-- About The Contributor -->
    <div class="dash"></div>
    <div class="author">
    <h3>About the Contributor</h3>
    <?php echo get_avatar( get_the_author_email(), '80' ); ?><p>
    <?php the_author_meta('user_description'); ?></p></div>
    <!-- //About The Main Contributor -->
  10. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    You should be good with a snippet like this: https://gist.github.com/2865113 You'll want to stick that into your functions.php, and then use the function within the loop where you'd like the bios displayed.

  11. guitargeek_com
    Member
    Posted 2 years ago #

    Cool! Which part is the function that goes within the loop?

  12. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    You can use capx_display_coauthor_bios() within the loop

  13. guitargeek_com
    Member
    Posted 2 years ago #

    Daniel - You are the KUNG FU CODE MASTER! I bow to you - Adam

  14. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Glad to hear it worked out :)

  15. guitargeek_com
    Member
    Posted 2 years ago #

    I'll post an example once I've uploaded everything.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic