Creating a Directory of Registered Users in WordPress

Thursday, August 27th 2009

First 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:

  1. Download and install the plugin
  2. 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.

Next up, Creating an Author Template in WordPress »

Your Comments

Much Ado About Nothing

8 comments

rss feed

  1. Felipe Wednesday, September 23, 2009 at 6:26 pm

    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

    • Daniel Quinn Wednesday, September 23, 2009 at 6:39 pm

      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.

      • Felipe Wednesday, September 23, 2009 at 6:50 pm

        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...

        • Felipe Wednesday, September 23, 2009 at 7:08 pm

          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

          • Felipe Wednesday, September 23, 2009 at 7:12 pm

            Well... Crazyness.... Everyting works fine...

            Sorry for the 'almost-spam' commentting...

            It was only some lines after "?>" .... and commented lines...

            Thanks again,
            Felipe

            • Daniel Quinn Wednesday, September 23, 2009 at 11:37 pm

              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...)

  2. Alvin Crespo Tuesday, October 27, 2009 at 9:15 pm

    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

    • Daniel Quinn Tuesday, October 27, 2009 at 9:18 pm

      Hi there, I was actually editing it at the exact moment you went to look at it. Try again :)

Speak Your Mind

For Scathing Rebuttals

Enclose code in <code></code> brackets.