Following is the shortcode for member listing you can use this in your post and pages:
[members-listing]
- title ( title= “Members” ): Accepts any string value for the title
- Type ( type= “alphabetical” ): Accepts “active”, “random”, “alphabetical”, “newest”, and “popular”.
- Per_page ( per_page= “5”): Accepts any positive number. The default is 20.
- Max ( max= “5” ): Accepts any positive number. The default is false(unlimited).
- Include ( include= “21, 3, 22” ): Accepts string of comma-separated members ids. This value defaults to the ID of that item. Otherwise, the default is “false”.
- Exclude ( exclude= “21, 3, 22” ): Accepts string of comma-separated members ids. This value defaults to the ID of that item. Otherwise, the default is “false”.
- member_type ( member_type= “student” ): accepts “string” value.
- include_member_role ( include_member_role= “administrator” ): Accepts string of comma-separated members roles.
- Exclude_member_role ( exclude_member_role= “administrator” ): Accepts string of comma-separated members roles.
- Loop-layout ( loop-layout= “two” ): Accepts “one”, “two”, “three”, and “four”.
[members-listing]
Here is the way you can specify options
[members-listing option_name=option_val option_name2=option_val2 and so on]
[members-listing title=Member_List object=Groups per_page=2].
The accepted parameters:-
- title (string):– What should be the title of the member’s section.
- type (string):- Sort order. Accepts ‘active’, ‘random’, ‘newest’, ‘popular’, ‘online’, ‘alphabetical’. Default: ‘active’.
- per_page (int|bool):- Number of results per page. Default: 20.
- max (int|bool):- Maximum number of results to return. Default: false (unlimited).
[members-listing max=2]
- include (int|string):- Limit results by a list of user IDs. Accepts a single integer, a comma-separated list of IDs (to disable this limiting). Accepts ‘active’, ‘alphabetical’,’newest’, or ‘random’. Default: false.
- exclude (int|string):- Exclude users from results by ID. Accepts a single integer, a comma-separated list of IDs (to disable this limiting). Default: false.
- user_id (int):- If provided, results are limited to the friends of the specified user. When on a user’s Friends page, defaults to the ID of the displayed user. Otherwise defaults to 0.
- member_type (string):- Can be a comma-separated list. (Note: BuddyPress itself does not register any member types. Plugins and themes can register member types using the bp_register_member_type() or the bp_register_member_types() function.)
- include_member_role (string):- Can be a comma-separated list of members role.
- exclude_member_role (string):- Can be a comma-separated list of members role.
- member_type__in (string):- list only these members type ( Note: This parameter will work when member types exist.)
- member_type__not_in (string):- not list these members type ( Note: This parameter will work when member types exist.)
- search_terms (string):- Limit results by a search term. Default: value of `$_REQUEST[‘members_search’]` or `$_REQUEST[‘s’]`, if present. Otherwise false.
[members-listing search_terms=’zoya’].
- meta_key (string):- Limit results by the presence of a user meta key. Default: false.
- meta_value (string):- When used with meta_key, limit results by matching the user meta value. Default: false. Requires meta_key.
- container_class (string):- Default ‘members’. Allows changing the class of the shortcode contents wrapper.
This shortcode can take the following parameters:
Examples:-
[members-listing per_page=3]
How many items you want to shows. The default is 10.
[members-listing title=Wbcom_Design_Member]
This shortcode uses to show the title to the member list.
[members-listing include_member_role=’subscriber, admin’]
This shortcode used to displays the member list. and it accompanies a lot of parameters to customize which member is appeared and how they are spread out.