WordPress just released version 3.1.4. Overall, it’s a solid release but if you’re working with a theme that has support for multiple custom menus, then you may notice a regression with custom menus after you upgrade the application.
Specifically, all custom menu locations that do not contain a menu actually display all pages on the site. For example, if your Menu admin panel looks like this (notice three custom menus, two of which are empty:
Then your navigation area likely looks something like this (notice two menus displaying all content):
In order to fix this, you need to provide one extra argument in each place the custom menu is called. Locate the calls to wp_nav_menu in your code. You should find something that looks like this:
wp_nav_menu( array( 'sort_column' => 'menu-order', 'menu_class' => 'nav clearfix fl', 'container_id' => 'menu_top', 'container_class' => 'menu clearfix fl', 'show_home' => 0, 'theme_location' => 'top-menu' ) );
Add an argument to the array that instructs the system not to use a fallback function. The final code should look like this:
wp_nav_menu( array( 'sort_column' => 'menu-order', 'menu_class' => 'nav clearfix fl', 'container_id' => 'menu_top', 'container_class' => 'menu clearfix fl', 'show_home' => 0, 'theme_location' => 'top-menu', 'fallback_cb' => false ) );
This will prevent WordPress from defaulting to a menu. For more information on custom menus, check out the codex.
Leave a Reply
You must be logged in to post a comment.