• Hello,

    After upgrading to 4.1.1 I am having an issue with the main navigation that I cannot resolve. It is not displaying the primary navigation that is selected.

    https://forprevention.org/p2/staff-kind/staff/

    Under Appearance -> Menus I have ‘Main Menu’ set as the primary navigation.

    Within Header.php:
    ‘menu’ => ‘Main Menu’,

    Everything points to Main Menu yet for some reason it continues to show ‘Footer – About’ which happens to be the first to appear in the list of menus.

    Any ideas why this is occurring? Is there a location I should look in .PHP files or within the DB?

    This is my first post to the forums so please let me know if there are useful info I should add.

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you solved this since you posted? Thanks for the link.
    I am confused about the exact problem, since the menus top and footer are obviously different. Are you using a cache plugin and haven’t cleared cache and seeing something different than I see?
    Is it the order of items in the main menu? Is it just the ‘About’ section you don’t want there or do you want all items in this menu in a different order? The top and footer About sections are different. If so, in Appearance / Menus under Main Menu settings where it lists menu items, you can arrange the order they appear, add or delete whatever parts you want or don’t want to appear in Main Menu in each title’s drop arrow. Click the drop arrow to the right of About, there it will have Move Down or Remove. You can also drag each title to any order.

    Thread Starter BenReinhardt

    (@benreinhardt)

    I implemented a fix to the symptom but not to the problem. I found that the site was displaying which every menu appeared first in the list of menus as the primary navigation. It was ignoring the primary navigation checkbox.

    So I renamed the main menu to “1 – Main Menu” so that it appeared at the top of the list. This resolves the problem on the surface but not the actual underlying cause.

    My apologies that you were seeing the menu after I figured out this fix.

    Ah, thanks. Well, it appears to be a php prob with the menu calls between the upgrade and the theme functions with the walker nav. In wp includes nav-menu-template.php. / nav-menu.php. I am not versed in php, but saw this in nav-menu-template.php.

    // get the first menu that has items if we still can't find a menu
    	if ( ! $menu && !$args->theme_location ) {
    		$menus = wp_get_nav_menus();
    		foreach ( $menus as $menu_maybe ) {
    			if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) {
    				$menu = $menu_maybe;
    				break;
    			}

    So that tells me something somewhere is not identifying the proper object.
    This should point you in a direction. Someone else can help you. Or, you can also ask your theme support. Is there a theme update that may have addressed this? Sorry, I couldn’t do more for you.

    Thread Starter BenReinhardt

    (@benreinhardt)

    This is very helpful, thank you.

    The company that developed our theme went belly up.

    I’ll dig in the direction you have pointed, thank you for taking the time to help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Primary Navigation not displaying correct navigation’ is closed to new replies.