This plugin creates new pages for the Member Directory and the Member Profile page.

  • The Member Directory page lists members with desired profile information, an avatar, and a link to their Member Profile page (read-only).
  • The Member Profile page highlights each member individually but also links to Member Directory page (View All).

You can customize almost everything in your member directory, from the layout and fields displayed, to even allowing different profile and directory views based on the visitor’s own membership level.

Example Member Directory with Member Avatars

You can create the pages manually and add the block or shortcode, or let the plugin do it for you. To generate your new pages, select Memberships > Page Settings in the WordPress admin area.

Edit the pages to adjust block or shortcode attributes and update the display of your directory and member profiles, include members by level ID, and display custom user profile information.

Note: The Profile page should not be set to the same page or contain the same shortcode as your site’s “Member Profile Edit” page. The Directory’s Profile page is a static view of member data, whereas the Member Profile Edit page is where a single logged-in user can modify their profile information.

Video Demo

pmpro_member-directoryThe Member Directory

A directory can be inserted in any page or post via a Block or Shortcode ([pmpro_member_directory]). The following settings and attributes are available:

  • avatar_size: The square pixel dimensions of the avatar to display. Requires the “show_avatar” attribute to be set to ‘true’. default: ‘128’ (accepts any numerical value).
  • fields: Display additional user meta fields. default: none (accepts a list of label names and field IDs, i.e. fields="Company,company;Website,user_url").
  • layout: The format of the directory. default: div (accepts ‘table’, ‘div’, ‘2col’, ‘3col’, and ‘4col’).
  • levels: The level ID or a comma-separated list of level IDs to include in the directory. default: all levels (accepts a single level ID or a comma-separated list of IDs).
  • limit: the number of members to display per page
  • link: Optionally link the member directory item to the single member profile page. default: true (accepts ‘true’ or ‘false’).
  • order: Sort the results based on the order_by attribute in ascending or descending order. default: ASC (accepts ‘DESC’ or ‘ASC’).
  • order_by: The sort order for the results. default: ‘u.display_name’ (accepts ‘u.user_email’, ‘u.user_email’, ‘u.display_name’, ‘u.user_login’, ‘u.user_registered’, ‘mu.membership_id’, ‘mu.startdate’, ‘joindate’)
  • show_avatar: Display the user’s avatar generated via Gravatar or user-submitted using a plugin like Simple Local Avatars; default: true (accepts ‘true’ or ‘false’).
  • show_email: Display the user’s email address; default: true (accepts ‘true’ or ‘false’).
  • show_level: Display the user’s membership level; default: true (accepts ‘true’ or ‘false’).
  • show_search: Display a search form (searches on member display name or email address); default: true (accepts ‘true’ or ‘false’).
  • show_startdate: Display the user’s membership start date for their current level; default: true (accepts ‘true’ or ‘false’).

We have a list of shortcode examples at the bottom of this documentation page if you are using this method.

pmpro_member-profileThe Member Profile

A profile can be inserted in any page or post via a Block or Shortcode ([pmpro_member_profile]). The following settings and attributes are available:

  • avatar_size: The square pixel dimensions of the avatar to display. Requires the “show_avatar” attribute to be set to ‘true’. default: ‘128’ (accepts any numerical value).
  • fields: Display additional user meta fields. default: none (accepts a list of label names and field IDs, i.e. fields="Company,company;Website,user_url").
  • levels: The level ID or a comma-separated list of level IDs that allow profiles. default: all levels (accepts a single level ID or a comma-separated list of IDs).
  • show_avatar: Display the user’s avatar generated via Gravatar or user-submitted using a plugin like Simple Local Avatars; default: true (accepts ‘true’ or ‘false’).
  • show_bio: Display the user’s bio (if available); default: true (accepts ‘true’ or ‘false’).
  • show_billing: Display the user’s billing address (if available); default: true (accepts ‘true’ or ‘false’).
  • show_email: Display the user’s email address; default: true (accepts ‘true’ or ‘false’).
  • show_name: Display the user’s display name; default: true (accepts ‘true’ or ‘false’). Use our Force First Last plugin to batch update display names.
  • show_level: Display the user’s membership level; default: true (accepts ‘true’ or ‘false’).
  • show_phone: Display the user’s billing phone (if available); default: true (accepts ‘true’ or ‘false’).
  • show_search: Display a search form (searches on member display name or email address); default: true (accepts ‘true’ or ‘false’).
  • show_startdate: Display the user’s membership start date for their current level; default: true (accepts ‘true’ or ‘false’).
  • user_id: Show a specific member’s profile; default: none (accepts any numeric uesr id, i.e. user_id=”125″).

Members can opt out of the member directory by checking the “Hide from Directory?” field on the “Edit Profile” page.

We have a list of shortcode examples at the bottom of this documentation page if you are using this method.

Member Directory Blocks

File-Type Profile Fields

If you are displaying a field that is a file type (audio, video, image, document), the shortcode will attempt to embed or display the file based on the mime type (about WordPress filetypes).

  • Audio files will embed using the WordPress [audio] shortcode
  • Document files will display the appropriate wp_mime_type_icon and a link to view or download the file
  • Image files will display as a standard image on the page at full size
  • Video files will embed using the WordPress [video] shortcode

Third-Party Embeddable Links (YouTube, Vimeo, etc.)

The field will also display as an embed (list of supported sites here) if the field value can be embedded via oEmbed (about WordPress oEmbeds).

Installation

You must have the Paid Memberships Pro plugin installed and activated with a valid license type to use this Add On.

  1. Navigate to Memberships > Add Ons in the WordPress admin.
  2. Locate the Add On and click “Install Now”.
    • To install this plugin manually, download the .zip file above, then upload the compressed directory via the Plugins > Add New > Upload Plugin screen in the WordPress admin.
  3. Activate the plugin through the Plugins screen in the WordPress admin.

Setup

  1. Navigate to Memberships > Settings > Pages in the WordPress admin.
  2. Locate the “Additional Page Settings” section.
  3. Click the “Generate Page” button to create a new page for your Directory and individual Profile.
    • Note that these pages can also be created manually and then assigned to these Page Settings after they are published.
  4. Save Settings.

Customizations, Theme Compatibility, and Styling

The screenshots in these docs use the Memberlite Theme, which provides full integration and additional styling for the Member Directory and Profile Pages Add On.

Theme authors and developers can create a custom template for the Directory and Profile via two methods: a template in the active theme folder or a template loaded via a customization plugin.

Theme authors should use the theme method as outlined in this document. The files directory.php and profile.php should copied out of the Add On plugin files and placed in a new /paid-memberships-pro/pmpro-member-directory/ folder in your theme.

If you are not a theme author looking to build support for this Add On, we recommend using a customizations plugin and creating a new shortcode (rename the directory or profile shortcode in the Add On to something unique for your site) and require that template file in your customizations plugin main file.

Member Directory and Profile Search

By default, the search fields in this Add On will search the following profile values: user_login, user_email, display_name, and all usermeta fields.

Some servers may not allow the large queries needed to execute a directory and profiles search. You will know this is the case if you are using the search form and no results are returned when you know results should be returned.

The recipe below can be used to allow your hosting environment to process the large JOIN operations needed for this Add On.

Shortcode Examples

Show only level IDs 1 and 4, hide avatars and email address:

[pmpro_member_directory levels="1,4" show_avatar="false" show_email="false"]

Show all level IDs, hide level name and start date:

[pmpro_member_directory show_level="false" show_startdate="false"]

Show custom user meta fields using the “fields” attribute in the format Label,key;Label,key:

[pmpro_member_directory fields="Company,company;Website,user_url"]

Show a unique member directory by level. Level 1 Members can only see other Level 1 Members…:

[membership level="1"]
[pmpro_member_directory levels="1"]
[/membership]

[membership level="2"]
[pmpro_member_directory levels="2"]
[/membership]

[membership level="3"]
[pmpro_member_directory levels="3"]
[/membership]

Show unique member profiles based on level – hide user phone number and email address.

[membership level="1"]
[pmpro_member_profile show_email="false" show_phone="false"]
[/membership]

[membership level="2"]
[pmpro_member_profile show_email="true" show_phone="true"]
[/membership]

Action and Filter Hooks

The following actions and filters are available in this Add On:

do_action( 'pmpro_member_directory_before', $sqlQuery, $shortcode_atts );

apply_filters( 'pmpromd_profile_url', string $profile_url );

apply_filters( 'pmpro_member_profile_fields', array $fields_array, user $pu );

apply_filters( 'pmpro_member_directory_sql_parts', array $sql_parts, string $levels, string $s, int $pn, int $limit, int $start, int $end, string $order_by, string $order );

The $levels parameter is a single level ID or a comma-separate list of IDs (not an array of level IDs).

The $sql_parts parameter is an array of each section of the SQL query for building your list of members to include in the directory. The sections of the array you can modify include:

  • $sql_parts['SELECT']
  • $sql_parts['JOIN']
  • $sql_parts['WHERE']
  • $sql_parts['GROUP']
  • $sql_parts['ORDER']
  • $sql_parts['LIMIT']

Screenshots

Member Directory – 4 Column Layout
Screenshot for a Member Directory with 4 Column Layout


Member Directory – Table Layout
Screenshot for a Member Directory with Table Layout


Member Profile
Screenshot for a Single Member Profile


Member Profile with File Embeds
Screenshot for a Single Member Profile with Embedded Content

This is a Plus Add On.

Plus Add Ons are included in all Plus or higher premium membership plans.