WordPress.org

Support

Support » Themes and Templates » [Resolved] Newly created menu automatically add all pages to it when a menu is not assigned

[Resolved] Newly created menu automatically add all pages to it when a menu is not assigned

  • Hi,

    I think I’m trying it wrong. I’ve created a new menu at a theme location using below code.

    wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_id' => 'rockbottomnav' , 'menu_class' => 'rockbottom-menu', 'theme_location' => 'rockbottomnav') );

    Everything works fine. But I’m wondering if it’s possible to not show all pages listed automatically on that navigation when that navigation is not assigned a menu via theme locations under menus. I’m sure this is possible but I just can’t seem to get it working.

    Thank you so much in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • paulwpxp
    Font hero

    @paulwp

    That’s because the default 'fallback_cb' is set to 'wp_page_menu'.

    So you could try adding this 'fallback_cb' => '__return_false'.

    Well my dear friend I can’t thank you enough. It’s quite simple but I’ll be remembering this until it is deprecated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Newly created menu automatically add all pages to it when a menu is not assigned’ is closed to new replies.