Creating a Directory of Registered Users in WordPress
Thursday, August 27th 2009First of all, create about 6 users under Users -> Add Users in WordPress, so we have some faces to work with. Then go ahead an install Members List. Quickest instructions for setting it up:
- Download and install the plugin
- Create a template in your theme called members.php. Put the following code in that template:
<?php
/**
* @package WordPress
* @subpackage Name_of_Your_Theme
*/
/* Template Name: Members */
get_header(); ?>
<div id="content" class="narrowcolumn" role="main">
<?php
$members = new tern_members;
$members->members(array('search'=>true,'pagination'=>true,'sort'=>true));
?>
</div>
<?php get_footer(); ?>
Finally, create a page in WordPress called "Members." Assign the "Members" template to that page and Publish.
Okay, great, now you should see your members list:
http://dev.dquinn.net/guest/members/
Of course, 2 problems remain:
- When you click on individual users, you go to the Author archive for that user, instead of an individual profile for the user.
- It's not yet integrated with the User Photo plugin.
Let's fix problem #1 first.

Great Work!
I'm still starting with Wordpress.. What a powerful tool!
I've almost all the steps until here, but I'm having some messages from the server, like:
Warning: Cannot modify header information - headers already sent by (output started at E:\vhosts\estrutural.blog.br\httpdocs\wordpress\wp-content\plugins\members-list\tern_wp_members.php:840) in E:\vhosts\estrutural.blog.br\httpdocs\wordpress\wp-login.php on line 299"
Well... the blog is hosted in a server (shared, I think), so that I can't change the PHP.INI file to make it not show WARNINGS, only ERRORS.
Any tip for that?
Thanks, and congratulations for this work...
Felipe
Hmm, that usually means there's a space or some other character at the beginning of the file indicated in the error. It could also have been borked when it was FTP'd to your server, since the errors are coming from within the Members List plugin.
Uow!
*THIS* is a fast answer!!
It's strange... It was all working before I went to lunch..
The PHP-code ends on line 838 of the file, so.. I thought It could be some "}" missing, but it is not..
Even some css-styles aren't working... look at this... =/
http://www.estrutural.blog.br/?page_id=13
Thanks in advance...
Well...
I've just download you "tern_wp_members.php", and uploaded to the server, but now error starts at funcions.php ...
I'll keep trying tomorow... Thanks for your support..
Regards,
Felipe
Well... Crazyness.... Everyting works fine...
Sorry for the 'almost-spam' commentting...
It was only some lines after "?>" .... and commented lines...
Thanks again,
Felipe
Glad you figured it out - sometimes we spend hours fighting with something, but it always ends up being something silly (like a missing semicolon!! Oh I remember that torture in my Flash days...)
Thanks for this tutorial, been looking around for some helpful info. But it seems that the following error is given when I click to view the example on this page:
Parse error: syntax error, unexpected $end in /nfs/c04/h01/mnt/58990/domains/dev.dquinn.net/html/guest/wp-content/plugins/usermeta/usermeta.php on line 98
Hi there, I was actually editing it at the exact moment you went to look at it. Try again
I tried the code, but I am not getting the alphabetical list nor the pagination features : (
Test here:
http://chooseavirb.com/bicl2/directory/
Using WP 3.0
Guys, stop using this method. WP 3.0 allows you to modify profiles extremely easily without the need for these plugins.
Hi, Dan.
Explain, since I am still not totally familiar with all that went under the hood with 3.0. How would we accomplish a members list in 3.0?
What I am specifically trying to do is two-fold:
1. List the members of my site in a directory (http://chooseavirb.com/bicl2/directory/)
2. Sort the users by their respective groups (clueless with this one...trying to write a PHP query to aggregate based on user_meta...http://chooseavirb.com/bicl2/groups/...help if possible)
Thanks for the clarification.
Basically I want to say 'if the user's meta value (from Cumy Extra Fields) is = to Barbados, then display all users on this page'.
A lil out of range of the original post, but after that I want to list the Barbados users in a Members' Directory.
Justin Tadlock explains how to use core functions to insert new profile fields in this article: http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields
You could just create a new profile field using the new methods, then create an author.php template (see the Codex) to list all the authors and sort them by that profile field.
Cimy + Flutter and all those in-betweens are unnecessary now, since we can add meta boxes really easily to posts and custom post types as well as add profile fields with core functions.