Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Tduffy17,

    Try something like this:

    $coauthors = get_coauthors(); 
    
    foreach( $coauthors as $coauthor ) {
    	$userdata = get_userdata( $coauthor->ID );
    
    	if ( $userdata->display_name ) {
    		echo '<h2>' . $userdata->display_name . '</h2>';
    	}
    
    	if ( $userdata->user_description ) {
    		echo '<p>' .  $userdata->user_description . '</p>';
    	}
    Thread Starter tduffy17

    (@tduffy17)

    Thanks Jeremy that works

    Hii Jeremy Varnham
    Thank you so much it works for me also

    This is not working for me.

    On my author.php using Jeremy’s example above, I get the following results:

    $coauthors = get_coauthors();
    foreach( $coauthors as $coauthor ){
    	$userdata = get_userdata( $coauthor->ID );
    	var_dump( $userdata ); //returns bool(false)
    	if ( $userdata->display_name ) { //returns "Notice: Trying to get property of non-object"
    		echo '<h2>' . $userdata->display_name . '</h2>';
    	}
    }

    Any ideas what I’m doing wrong?

    Hii Eric,
    try this one

    $coauthors = get_coauthors();
    foreach($coauthors as $each_author){
     $user_id = $each_author->ID;
     $user_deatils=get_user_meta($user_id);
      var_dump($user_deatils);
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Guest author Biographical Info on author.php’ is closed to new replies.