Custom Menu Not Displaying on '404 Error' Page.
-
As simple as the title, my custom menu is not displaying on the 404 error page, but it is displaying everywhere else as intended.
I’ve done the following to register the menu:
add_action( 'init', 'my_register_menu_function' ); function my_register_menu_function() { register_nav_menu('primary', __('Primary Navigation')); }
After which I call the menu in my theme by doing the following:
$args = array( 'theme_location' => 'primary', 'container' => '', 'container_class' => '', 'container_id' => '', 'menu_class' => '', 'menu_id' => '', 'items_wrap' => '%3$s'); wp_nav_menu($args); $cats = array( 'title_li' => __( '<a href="#">Categories</a>' ), 'taxonomy' => 'category' ); wp_list_categories( $cats ); $gens = array( 'title_li' => __( '<a href="#">Custom Taxonomy</a>' ), 'taxonomy' => 'custom_tax' ); wp_list_categories( $gens );
That produces the menu as an unordered list. The menu has been setup in the appearance menu, and everything works as intended on index, archive, category, page, single, and custom taxonomy pages. But, for one reason or another, the custom menu is not displayed on the 404 page, only the menu items I’ve generated by calling
wp_list_categories
gets shown.Any clue why it wouldn’t show up on this one page? Don’t recall this being a problem before the upgrade to 3.2.1. Also, because the site is not yet ‘live,’ I cannot provide a link.
- The topic ‘Custom Menu Not Displaying on '404 Error' Page.’ is closed to new replies.