Fetching user name, image and biographical info
-
I am trying to fetch all the users with a role contributor with their names images and biographical infos.
currently my code is `<?php $args = array(
‘role’ => ‘Contributor’,
);
$blogusers = get_users( $args, array( ‘fields’ => array( ‘display_name’, ‘get_avatar’) ) );
// Array of stdClass objects.
foreach ( $blogusers as $user ) {echo ‘<span>’ . esc_html( $user->display_name ) . ‘</span>’;
echo get_avatar();
} ?>`any way i can modify the code to do that
P.S. complete newbie
- The topic ‘Fetching user name, image and biographical info’ is closed to new replies.