• Resolved Saurabh

    (@sorb)


    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/

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

    (@danielbachhuber)

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

    Thread Starter Saurabh

    (@sorb)

    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.

    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    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; ?>
    Thread Starter Saurabh

    (@sorb)

    🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I think my theme is having different Tags.’ is closed to new replies.