Hi @tomatillo
It’s definitely possible. Actually, there’s probably many ways to do it.
Try adding this to your theme’s functions.php file:
function my_custom_bp_nav_menu( $args ) {
if ( bp_is_current_action( 'following' ) || bp_is_current_action( 'followers' ) )
$args['echo'] = false;
return $args;
}
add_filter( 'bp_nav_menu_args', 'my_custom_bp_nav_menu' );
Note: I haven’t tested.
Thanks for the quick reply. However this didn’t seem to work for me. I’m still learning BP. Could you explain how this works or post another snippet? Very much appreciated.
I’m using the bp_nav_menu_args
filter hook to modify the args sent to bp_nav_menu()
. The code assumes you’re using bp_nav_menu()
to display your navigation menu. By changing the value of $args['echo']
to false
, a string containing the nav menu markup is returned (i.e. not echo’d to screen).
The 2nd line is just a conditional to govern which pages the filter function applies to.
I didn’t get the chance to test it myself. Can you provide more info on how it isn’t working?