• Hi Everyone,

    Maybe someone here can help me. I have a custom theme that I am building. It’s almost ready for launch it’s having the most bizarre problem.

    My theme has 5 wp_nav_menus and all of a sudden one of the menu’s won’t update! I can’t make any changes to it. All the other menus still work but this one won’t. It has a LOT of navigational options in it so I suspect perhaps that this is a bug triggered when there are a certain number of items because it was working just fine until I started trying to fill it will items and then when I was almost done it stops updating.

    Obviously the first thing I did was reinstall wordpress just in case the last install had somehow gone wrong and with no luck. I also went and enabled PHP error visibility in wordpress: `ini_set(‘display_errors’, 1);
    error_reporting(E_ALL);`

    No errors show up the screen just goes white when I try to update and nothing happens. I also just in case tried updating in on multiple browser and OS although I didn’t think that would make a difference.

    Any thoughts? Anyone discovered this bug before? Any work around? It is a custom theme but I didn’t edit wordpress itself at all (except that error reporting at the end). I really need to be able to add that many items unfortunately it’s for a clients monster website. It currently has about 44 items and needs about 60. (I know it’s ridiculous but it’s not my call)

    Thanks to anyone with time to reply.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter CodePretty

    (@codepretty)

    oh and I enabled debugging in wp-config and the only think it did was find an error in a plugin but uninstalling the plugin didn’t help. ??

    Where is the menu in the code that is not working? Are they all the same?

    Thread Starter CodePretty

    (@codepretty)

    Yes they are all the exact same. I’m pretty sure this is a wordpress bug.

    working menus code:

    <?php wp_nav_menu( array( 'container' =>  'span', 'theme_location' => 'primary' ) ); ?>
    <?php wp_nav_menu( array( 'container_class' => 'cbs-top-menu', 'menu_class' => 'sf-menu', 'theme_location' => 'top' ) ); ?>
    <?php
    wp_nav_menu( array( 'container_class' => 'footer-box', 'menu_class' => 'footer-box', 'theme_location' => 'footer-box', 'depth' => '1' ) );
    ?>
    <?php wp_nav_menu( array( 'container_class' => 'cbs-footer-menu', 'menu_class' => 'footer-links', 'theme_location' => 'footer', 'depth' => '1' ) ); ?>

    No longer working:

    <?php wp_nav_menu( array( 'container_class' => 'cbs-sub-menu','menu_class' => 'sf-menu', 'theme_location' => 'submenu' ) ); ?>

    Register Menu:

    register_nav_menus( array(
    	'primary' => __( 'Large Red Navigation', 'crossbordershopping' ),
    	 'top' => __('Top Grey Navigation Bar', 'crossbordershopping'),
    	 'footer' => __('Grey Footer Menu', 'crossbordershopping'),
    	 'submenu' => __('Second Grey Menu Below Red Menu', 'crossbordershopping')
    	 'footer-box' => __('Footer Directory', 'crossbordershopping')
    ) );

    As mentioned they are all basically the same. The only difference between them is that one has more items. They were all working great until I started adding items then all of a sudden after the 44th item it just stop working on that menu.

    Don’t know if it matters to your problem but you are missing a comma at the end of:
    ‘submenu’ => __(‘Second Grey Menu Below Red Menu’, ‘crossbordershopping’),

    Thread Starter CodePretty

    (@codepretty)

    my bad sorry that’s a copy and paste error not an original code error I just checked. Alas that’s not the problem wouldn’t that have been nice though. ??

    Thread Starter CodePretty

    (@codepretty)

    Oh this is a bizzare update as well. I can get that menu to update work while debug is turned on but as soon as debug is off it stops. I really can’t turn over my theme with debug on unfortunately.

    Did you happen to solve this problem? I’m hitting the same issue.

    Not for nothing, but I fully duplicated my nav (new name, etc) and things seem to have sorted themselves out.

    For now.

    Hi, I have encountered the same problem but in different way. I have 2 servers (not same, but pretty similar configuration both hardware and software).

    1) 1st server, menu working fine (more than 60 items in 4 levels in one menu).
    2) migrating whole WP to 2nd server (sort like 1:1 copy), everything is all right

    3) as soon as I try to change (add, delete, move) the menu on 2nd server, after submit menu is cropped to first 30 items.

    So it looks like this bug appears just some times.

    Any help?

    I’m having the same problem on one of my sites:

    https://joshstevensfoundation.org/category/events
    https://joshstevensfoundation.org/kind-like-josh/

    It’s only on the events calendar page that the nav changes. That nav that it is loading doesn’t exist in that form anymore, that is an older version before I added the store to the site. I remember it.

    So WP is loading an older version and it will not update or change. I tried adding a new menu but that didn’t work either. On those pages, it’s refusing to show any menu but that old one.

    I also encountered this problem: one of my menus (in the footer) would not update or change. I deleted it and recreated it, named it something else, etc. and it still wouldn’t change.

    I found a workaround of sorts by adding a second “primary” menu to my theme. If you look in Appearance > Menus, there’s a “Theme Locations” box where you can define which menu is your primary navigation. I already had a menu that was “primary” (and working fine) so I created a second “theme locations” drop-down in functions.php.

    Look for “// This theme uses wp_nav_menu() in one location” in functions.php. I edited the code beneath it to read:

    register_nav_menus( array(
    		'primary' => __( 'Primary Navigation', 'twentyten' ),
    		'footer'  => __( 'Footer Menu', 'twentyten' ),
    	) );

    Then in Appearance > Menus, I set my menu to be the Footer Menu. Finally, in the theme, I replaced my menu code with:

    <div class="menu">
    <?php wp_nav_menu( array( 'container' => '', 'container_class' => false, 'theme_location' => 'footer' ) ); ?></div>

    In other words, replace the name of your menu with the name you assigned it in functions.php (“footer”). And adding in that menu div class was important to my menu css.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘WordPress 3 Menu (wp_nav_menu) won't update’ is closed to new replies.