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.

Category:
Notes
Tags:

Join the conversation! 6 Comments

  1. And where might this code be found? I checked everywhere I can think of, and cannot find it.

  2. Standard Theme.

    I upgraded to 3.2 without a problem. A friend of mine has the problem, and he is also using ST, and he asked me what he could do to fix it.

    I submitted a ticket over at 8bit.io

  3. I found it in standardtheme.php

    Now I will try the fix suggested above, and see if it works.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.