In Wordpress there is an author.php template file that you can use to display author information. I am wondering if there is a way to create a template file to display a us
a. Create a template called members.php and put code snippet like this on that file:
global $wpdb; $query = "SELECT ID from $wpdb->users"; $author_ids = $wpdb->get_results($query); $users = array(); foreach($author_ids as $author) { // Get user data $curauth = get_userdata($author->ID); // Get link to author page $link = "/member/" . $curauth->user_nicename; $name = $curauth->display_name; $users[$link] = $name; } asort($users); ?>
b. Create a wordpress page called members using above template. This page will list all blog registered users with a ink to a page /member/user-name
.
c. Now create your author.php template displaying user information with code snippet like this:
get_queried_object();
$authid = $curauth->ID;
?>
Email: user_email; ?>
Website: user_url; ?>
Name: user_firstname . " " . $curauth->user_lastname; ?>
Bio: user_description; ?>