• In the author template, how do we substitute the following code to get the current guest author name?

    $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
    ?>
Viewing 1 replies (of 1 total)
  • I’m no expert, and this is my first submit in this forum, but I thought this might help. I personally went for a different direction than the one described in the author.php template.

    if ( $coauthors_plus->is_guest_authors_enabled() ) {
    	$coauthor = $coauthors_plus->guest_authors->get_guest_author_by( 'user_nicename', $author_name);
    	}
    	if ( !empty($coauthor) ) {
    		echo 'Guest';
    	}else{
    		$coauthor = $coauthors_plus->get_coauthor_by( 'user_nicename', $author_name );
    		echo 'Member';
    	}	

    From ther you can use the $coauthor variable to get all the meta information you need. Like

    <?php echo $coauthor->display_name; ?>
    <?php echo coauthors_get_avatar( $coauthor, 90 ); ?>
    <?php echo $coauthor->description; ?>

    Hope it helps

Viewing 1 replies (of 1 total)
  • The topic ‘Author page’ is closed to new replies.