1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Change the Number of Members displayed in the Members Directory

How to Change the Number of Members displayed in the Members Directory

Introduction

The BuddyBoss platform displays 20 members per page with 3 columns by default in the Members Directory. You can increase this number by adding a small custom function to your active theme. This guide explains how to change the number of members displayed in the members directory.

Custom Workaround

Before proceeding, make sure you have a complete site backup.

  1. Go to Appearance > Theme Editor in your WordPress admin dashboard.
  2. Under Select theme to edit, choose your active theme (preferably a BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, open Theme Functions (functions.php).
  4. Add the following code just before the closing PHP tag (?>):
add_action( 'bp_after_has_members_parse_args', 'bb_increase_members' );

function bb_increase_members( $args ) {

    $args['per_page'] = 24; // Change this number to set the desired member count per page

    return $args;

}
  1. Click Update File to save the changes.

Note: Modifications are typically considered custom work, but we are making an exception in this case. Please review the BuddyBoss Support Policy.

Troubleshooting and FAQs

Q: The member count didn’t change.
A: Make sure the code is added to the active theme’s functions.php file. Clear any caching plugins and refresh the page.

Q: Can I set the number of members to any value?
A: Yes. Replace 24 with any number you prefer.

Q: Will this change the number of columns per row?
A: No. This function only changes the number of members displayed per page. Column layout is controlled separately by the theme CSS.

Q: Can I revert this change easily?
A: Yes. Remove the code from functions.php and save the file.

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

To speak to our Agency consultant, fill in the form found at our Contact Page.

  • Get Started

    Enter your name and email address to get started with your project...

  • This field is for validation purposes and should be left unchanged.