WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] I think my theme is having different Tags. (5 posts)

  1. Saurabh
    Member
    Posted 1 year ago #

    My theme is having separate author-bio.php file for Author box which is getting called at the end of article. The Author-bio.php is having this code:

    <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
    <div id="author-bio">
    
    <div id="author-avatar">
    <?php echo get_avatar( get_the_author_meta( 'user_email' ), 68 ); ?>
    </div><!-- #author-avatar -->
    
    <div id="author-description">
    <h2><?php printf( __( 'About %s', TEMPLATE_DOMAIN ), get_the_author() ); ?></h2>
    <?php the_author_meta( 'description' ); ?>
    <div id="author-link">
    <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
    <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', TEMPLATE_DOMAIN ), get_the_author() ); ?>
    </a>
    </div><!-- #author-link	-->
    </div><!-- #author-description -->
    </div><!-- #author-info -->
    <?php endif; ?>

    Please tell me how to integrate Co-Authors. It would be great if you can provide modified version of this code with co-authors plugin code integration. I don't know much about PHP Coding.
    My Concerned Site - Techgyd
    Thanks in advance.

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

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Do you want to show two bios if two bylines are assigned, or how should that work?

  3. Saurabh
    Member
    Posted 1 year ago #

    Hello Daniel,
    Thanks for the reply.
    Actually, I wants to modify this code in such a way so that co-authors plus will be integrated but, 'I don't know how to modify that code'.

    I only wants to show single byline of the author that I will assign using Co-Authors (whether Guest Authors, Contributors, Editors etc.).

    It would be great if you can also tell me how to put custom image for any Guest Authors (replacing their Avatar)and also, how to integrate Google Authorship of those Guest Authors.

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Ok. Try this instead:

    <?php $author = array_shift( get_coauthors() ); ?>
    <?php if ( $author->description && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
    <div id="author-bio">
    
    <div id="author-avatar">
    <?php echo get_avatar( $author->user_email, 68 ); ?>
    </div><!-- #author-avatar -->
    
    <div id="author-description">
    <h2><?php printf( __( 'About %s', TEMPLATE_DOMAIN ), $author->display_name ); ?></h2>
    <?php echo $author->description; ?>
    <div id="author-link">
    <a href="<?php echo esc_url( get_author_posts_url( $author->ID, $author->user_nicename ) ); ?>" rel="author">
    <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', TEMPLATE_DOMAIN ), $author->display_name ); ?>
    </a>
    </div><!-- #author-link	-->
    </div><!-- #author-description -->
    </div><!-- #author-info -->
    <?php endif; ?>
  5. Saurabh
    Member
    Posted 5 months ago #

    :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags