Skip to:
Content
Pages
Categories
Search
Top
Bottom

Replace main theme menu with Custom menu on Buddypress pages


  • jayvly
    Participant

    @jayvly

    Hi,

    I have setup BuddyPress on my dev site in the members section at jabbragency.net/jb/scotianaires/.
    I have Menu Swapper installed and it works great on all pages where I want it in the member section except for BuddyPress.

    I have tried adding the following code to my child theme functions.php but that is not working.

    
    // =============================================================================
    // Sets Custom Menu For Buddypress Pages 
    // =============================================================================
    
    // 
    // Replace 'is_buddypress' with any other conditional tag
    // 
    
    add_filter( 'wp_nav_menu_args', 'custom_buddypress_menu' );
    
    function custom_buddypress_menu( $args ) {
      if ( is_buddypress() ) {
        $args['theme_location'] = 'primary';
        $args['menu'] = 'Custom Menu';
      }
      return $args;
    }
    

    I am wondering where I have gone wrong?

    Cheers,

    Jonathan

Viewing 1 replies (of 1 total)

  • jayvly
    Participant

    @jayvly

    ***UPDATE***
    Sorry, I had the name wrong and that code did work!

    Cheers,

    Jonathan

Viewing 1 replies (of 1 total)
  • The topic ‘Replace main theme menu with Custom menu on Buddypress pages’ is closed to new replies.
Skip to toolbar