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>';
}
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);
}