Parameters for Group Listing – Shortcodes For BuddyPress

The [groups-listing] shortcode allows you to display a list of groups on your WordPress pages or posts with customizable parameters. Here’s an explanation of each parameter with examples to help you understand their functionality:


1. title

Description: The title displayed above the group listing.
Type: string
Example:
[groups-listing title="Community Groups"]
This will display “Community Groups” as the title above the group list.


2. type

Description: Predefined sorting options for groups.
Accepted Values: "newest", "active", "popular", "alphabetical", "random"
Default: alphabetical
Example:
[groups-listing type="newest"]
This will display the newest groups first.


3. page

Description: Specifies the page number of results to display for pagination.
Type: int
Default: 1
Example:
[groups-listing page="2"]
This will display the second page of groups.


4. per_page

Description: Number of groups to display per page.
Type: int
Default: 20
Example:
[groups-listing per_page="3"]
This will show 10 groups per page.


5. max

Description: Shows the max count of groups found.
Type: int|bool
Default: false (unlimited)
Example:
[groups-listing max="10"]

 


6. page_arg

Description: The query parameter string used for pagination.
Type: string
Default: grpage
Example:
[groups-listing page_arg="custom_page"]
Pagination links will use ?custom_page= instead of ?grpage=.


7. container_class

Description: The CSS class for the container of the group listing.
Type: string
Default: group
Example:
[groups-listing container_class="custom-group-list"]
This will add the custom-group-list class to the container.


8. exclude

Description: Excludes specific groups by their IDs.
Type: array|string
Default: false
Example:
[groups-listing exclude="1,2,3"]
This will exclude groups with IDs 9, 17, and 33.


9. update_meta_cache

Description: Fetch group metadata for the queried groups.
Type: bool
Default: true
Example:
[groups-listing update_meta_cache="false"]
This will not fetch group metadata, improving performance.


10. include

Description: Includes specific groups by their IDs.
Type: array|string
Default: false
Example:
[groups-listing include="9,17,33"]
This will only show groups with IDs 9, 17, and 33.

 


11. meta_query

Description: Filters groups based on specific metadata conditions.
Type: array
Default: false
Example:
[groups-listing meta_query='{"key":"location","value":"NY"}']
This will display groups where the location metadata is “NY.”


12. order

Description: Defines the order of results.
Accepted Values: "ASC" or "DESC"
Default: DESC
Example:
[groups-listing order="DESC"]
This will display results in Descending order.


13. orderby

Description: Property to sort groups by.
Accepted Values: "date_created", "last_activity", "total_member_count", "name", "random"
Default: last_activity
Example:
[groups-listing orderby="name"]
This will sort groups alphabetically by name.


14. search_terms

Description: Filters groups by a search term.
Type: string
Default: false
Example:
[groups-listing search_terms="Nature"]
This will display groups whose descriptions include “Nature.”

 


15. slug

Description: Filters groups by a specific slug.
Type: string
Default: false
Example:
[groups-listing slug="nature-lovers"]
This will display the group with the slug “nature-lovers.”


16. user_id

Description: Limits results to groups of which the specified user is a member.
Type: int
Default: 0
Example:
[groups-listing user_id="10"]
This will display groups where the user with ID 10 is a member.

 

 


17. group_type

Description: Limits results to specific group types.
Type: string|array
Example:
[groups-listing group_type="private"]
This will display only private group types.


18. group_type__not_in

Description: Excludes specific group types from results.
Type: string|array
Default: false
Example:
[groups-listing group_type__not_in="private"]
This will exclude private groups.


19. show_hidden

Description: Includes hidden groups in the results.
Type: bool
Default: false
Example:
[groups-listing show_hidden="true"]
This will include hidden groups in the listing.


20. parent_id

Description: Filters results to show only child groups of specified parent groups.
Type: array|string
Default: null
Example:
[groups-listing parent_id="1"]
This will display only child groups of the group with ID 1.

Update on April 9, 2025