Support » Fixing WordPress » WP 4.0 Broke Main Menu

  • Resolved shainanz

    (@shainanz)


    Hi there,
    Just updated my site to WP 4.0 and all is well except my main menu. It is no longer aligned correctly and it is using a different menu than the one set in WP-Admin. In WP-Admin > Appearance > Menus, everything looks normal, including the location settings.

    See what is happening here.

    The weird thing is that I have another site that is almost identical in terms of structure and menu, and it’s totally fine.

    Any ideas on what’s going on?

Viewing 4 replies - 31 through 34 (of 34 total)
  • Snowyn

    (@snowyn)

    I am having a similar/related problem, partially fixed, will continue investigating. Website is:
    http://WriteYourBestsellerBook.com/
    When I upgraded to WP 4.0, only the “top” level of the menu appeared. All the dropdowns were gone. My theme is custom, done by me. No cache plugins or menu plugins. Following some earlier advice in this thread, I changed
    <?php wp_nav_menu( ); ?>
    in my header.php file to:
    <?php wp_nav_menu( array( 'theme_location' => 'topMenu') ); ?>
    Now, the entire set of dropdown links IS displayed, but the dropdown’s parent/child structure is broken. In other words, every link is being displayed inline instead of block and dropping down. I’m guessing this is a CSS problem, and I will probably wind up tearing my hair out to fix it. (Yes, I know a lot of CSS, but formatting drop-downs has never been my strong point.)
    I find it EXTREMELY FRUSTRATING to have something that works fine in WordPress Version.Number suddenly be BROKEN in Version.Number+1, or Version+1.0. I REALLY WISH that the folks who do the WordPress upgrades would stop making “improvements” that break people’s themes.

    Moderator Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Hi Guys;

    I’ve had the same issue – I found the quickest and easiest fix was to replace the following core files from previous version (3.9.2).

    Files found in /wp-includes/

    – nav-menu-template.php
    – nav-menu.php

    Might not be the BEST fix, but definately fixed it for me (it was the only issue that I had with my theme).

    Hope it helps someone out there.

    Peace.

    It was 99% the same code. I found the 1%.

    The site that worked used:
    <?php wp_nav_menu( array(‘menu’ => ‘Main Menu’ )); ?>

    The site that didn’t work used:
    <?php wp_nav_menu( array(‘menu’ => ‘Primary Menu’ )); ?>

    “Main Menu” is what I have in the Menu Name field in Appearance > Menus, and “Primary Menu” is the theme location of the menu. In the older version of WP (still active on my live site so I just verified this), using the theme location in the function worked fine. In WP 4.0, it looks like only the Menu Name works in the function. Since it couldn’t find a menu called “Primary Menu,” it chose the first menu in my list alphabetically.

    Happily resolved! Thanks for the guidance 🙂

    this was the problem exactly for me. deleted a (unused) menu that came before Primary alphabetically so that my Primary menu appeared.

Viewing 4 replies - 31 through 34 (of 34 total)
  • The topic ‘WP 4.0 Broke Main Menu’ is closed to new replies.