The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Newly created menu automatically add all pages to it when a menu is not assigned (3 posts)

  1. Majon
    Posted 3 years ago #


    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.

  2. paulwpxp
    Font hero
    Posted 3 years ago #

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

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

  3. Majon
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic