1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Move the Members Directory Search Filter to the Top on Desktop View

How to Move the Members Directory Search Filter to the Top on Desktop View

Introduction

By default, the Members Directory search filter in BuddyBoss appears in its standard location. If you prefer the filter to appear at the top of the page on desktop view, you can achieve this with a custom function. This guide explains how you can move the Members Directory search filter to the top of the page.

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 BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, click Theme Functions (functions.php).
  4. Paste the following code just before the closing PHP tag (?>):
add_action( 'bp_before_directory_members_page', 'show_filter_on_top_members_page' );

function show_filter_on_top_members_page() {

    if ( bp_disable_advanced_profile_search() ) {

        return false;

    }

    $form_id = bp_profile_search_main_form();

    $template = bp_locate_template( 'common/search/profile-search.php', false, false );

    include $template;
}
  1. Click Update File to save your 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 search filter is not appearing at the top.
A: Ensure the code is added to the active theme’s functions.php file and that Advanced Profile Search is enabled in BuddyBoss.

Q: Does this affect mobile view?
A: No. This modification targets desktop view only.

Q: Can I style the filter differently once it’s at the top?
A: Yes. You can use CSS to adjust its position, spacing, or appearance.

Q: Will this be overwritten by BuddyBoss updates?
A: If added to a child theme, the code will remain intact during updates.

Q: Who can I contact for further assistance?
A: Please review the BuddyBoss Support Policy or consult a developer for custom work

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.