• <?php get_header(); ?>
    <div id="content" class="grid_8 <?php echo of_get_option('blog_sidebar_pos') ?>">
    	<?php
    
    	global $coauthors_plus;
    	if (isset($coauthors_plus)) {
    		$curauth = $coauthors_plus->get_coauthor_by( 'user_nicename', $author_name );
    	} else {
        		if(isset($_GET['author_name'])) :
          		$curauth = get_userdatabylogin($author_name);
          		else :
          		$curauth = get_userdata(intval($author));
        		endif;
    	}
    
      ?>
      <div class="author-info">
        <div class="header-title"><h1><?php _e('About:', 'theme1965'); ?> <span><?php echo $curauth->display_name; ?></span></h1></div>
        <p class="avatar">
          <?php if(function_exists('get_avatar')) { echo get_avatar( $curauth->user_email, $size = '120' ); } /* Displays the Gravatar based on the author's email address. Visit Gravatar.com for info on Gravatars */ ?>
        </p>
    
        <?php if($curauth->description !="") { /* Displays the author's description from their WordPress profile */ ?>
          <p><?php echo $curauth->description; ?></p>
        <?php } ?>
      </div><!--.author-->

    You can also add the other co-other fields if the plugin is enabled, just test for it.

    $curauth->display_name
    $curauth->first_name
    $curauth->last_name
    $curauth->user_login
    $curauth->user_email
    $curauth->linked_account
    $curauth->website
    $curauth->aim
    $curauth->yahooim
    $curauth->jabber
    $curauth->description

    https://www.ads-software.com/plugins/co-authors-plus/

  • The topic ‘Here is sample code to get Co-Author working on author page’ is closed to new replies.