WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] [closed] Guest author "about" info not displayed (8 posts)

  1. Josh
    Member
    Posted 1 year ago #

    Guest author bio information is not showing up in my "about author" boxes. See this article for example. The about author info appears to be for whoever the previous 'real' user/author was.

    This is the code my theme uses to call the author box info:

    <section id="author-info">
    	<header>
    		<h3>
    			<?php
    				printf( __( 'About the Author: <a href="%s" rel="author">%s</a>', 'btp_theme' ),
    					esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    					get_the_author()
    				);
    			?>
    		</h3>
    	</header>
    	<div>
    		<p id="author-avatar"><?php echo get_avatar( get_the_author_meta('email'), 80 ); ?></p>
    		<p id="author-description"><?php the_author_meta('description'); ?></p>
    	</div>
    </section>

    This works fine for regular authors (it doesn't display multiple author bios, but that's a separate issue I haven't tackled yet), but not for guest authors.

    I've tried replacing "the_author_meta" with a few CoAuthor variables, but nothing seems to work. I've poked around the plugin code a bit but haven't been able to make much headway.

    Any suggestions? I'm hoping I just missed a variable somewhere...

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

  2. gary.d
    Member
    Posted 1 year ago #

    You'll have to loop through the multiple authors. This works, but there's no formatting, but might help you get the right variables in the right places.

    <?php if ( function_exists( 'coauthors_posts_links' ) ) { ?>
    <!-- if the plugin is installed we'll deal with it here -->
    <?php if ( 1 == count( get_coauthors( get_the_id() ) ) ): ?>
    <!--// If there's only one author this bit will handle it -->
    <?php the_author_meta( 'display_name' ); ?><br  />
    <?php the_author_meta( 'user_email' ); ?><br  />
    <?php the_author_meta( 'description' ); ?><br  />
    <?php else: ?>
    <!--// Multiple authors, so loop through them -->
    <?php $coauthors = get_coauthors(); ?>
    <?php foreach( $coauthors as $coauthor ) : ?>
    <?php echo $coauthor->display_name;?><br />
    <?php echo $coauthor->user_email;?><br />
    <?php echo $coauthor->description;?><br /><br />
    <?php endforeach; ?>
    <?php endif; ?>
    <?php } else { ?>
    <!-- plugin not installed so fall back to standard wordpress -->
    <?php the_author() ?>
    <?php } ?>

    So it checks if the plugin is installed, then counts the number of authors (id's) associated with this post. If there's one then the next few lines are executed. More than one author then it loops through each one. Finally if the plugin isn't installed it just goes on to the usual wordpress stuff.

    Sorry about the formatting, been a long day.

  3. joecap1
    Member
    Posted 1 year ago #

    I am using Wp Biographia....I would like to have that plugin display a bio meta box on the post for each author....I have co-authors plus installed and both authors are added properly...

    How do I get WP Biographia and Co-Authors plus to work together so that there are two bios being pulled in...

    http://www.omnimedfinancial.com/disability-insurance-for-physicians/

  4. joecap1
    Member
    Posted 1 year ago #

  5. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    @joecap1 Please don't hijack existing threads.

  6. joecap1
    Member
    Posted 1 year ago #

    hijack.....strong choice of words.

  7. joecap1
    Member
    Posted 1 year ago #

    I am just trying to get this figured out....sorry if i posted in the wrong place or if i posted too often....

    Do you know of any way to get two author boxes to appear in Genesis theme that shows social links, using your plugin?

  8. @joecap, please start your own thread with your own details.

    http://wordpress.org/support/plugin/co-authors-plus#postform

    This one has been marked resolved already.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.