How It Works

This plugin creates 2 shortcodes for a Member Directory and Member Profile pages, which can be defined in Memberships > Page Settings of the WordPress admin.

pmpro_member-directoryThe Member Directory

Shortcode attributes for [pmpro_member_directory] include:

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

pmpro_member-profileThe Member Profile

Shortcode attributes for [pmpro_member_profile] include:

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


Notes about File-type 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 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 shortcode

Notes about other 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

  1. Members with a valid PMPro Plus license can install and activate this add on via the Memberships > Add Ons admin page. Or, download the zip file (above) and upload the ‘pmpro-member-directory’ directory to the ‘/wp-content/plugins/’ directory of your site.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Create a page for your directory and set the appropriate shortcode attributes and “Require Membership” settings per your needs.
  4. Create a page for your profile and set the appropriate shortcode attributes and “Require Membership” settings per your needs.
  5. Navigate to Memberships > Page Settings to assign your pages to the Directory and Profile page settings.

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

Screenshots

Member Directory – 4 Column Layout
pmpro_member_directory-avatars


Member Directory – Table Layout
pmpro_member-directory-table


Member Profile
pmpro_member-profile


Member Profile with File Embeds
pmpro_member_profile-files


Theme Compatibility and Styling

Please note that the screenshots above are using the Memberlite Theme, which provides full integration and additional styling for the Member Directory and Profile Pages Add On.

To achieve the rounded avatar style, copy and paste this CSS into your child theme or a stylesheet for PMPro Customizations:

img.avatar {
    border-radius: 50%;
    transition: transform 0.5s ease;
    transform: scale(0.8);
}