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.
- Go to Appearance > Theme Editor in your WordPress admin dashboard.
- Under Select theme to edit, choose your active theme (preferably BuddyBoss Child Theme), then click Select.
- From the Theme Files list, click Theme Functions (functions.php).
- 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;
}- Click Update File to save your changes.
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