• Hi,

    I don’t know if you’re aware of this, but we have noticed a pretty big bug. We have a series of menus set up and our main menu has some of these embedded into the structure. However, since the new upgrade, the entire menu has gone to pot. When we add one of the menus into the structure, there are a number of links that disappear – all of the top items that have a navigation menu attached to it. When I remove the sub-menu, the problem goes away. All I can see this being is this plugin, as I have disabled all of the possible suspects and only see the issue with this. Have you got any tips on how to fix this? Thanks in advance.

    https://wordpress.org/plugins/navception/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Faison

    (@faison)

    Hi natehawkes,

    That’s a pretty big bug :\
    If you need to fix this on an existing site right away, you can download version 1.0.0 on github here

    Now on to troubleshooting. Can you give me an example of what the menu structure looks like for the main menu and one of the sub menus that causes the issue? Also, are the menu items still in the html, but hidden, or are they completely removed from the html? I ask this because there was a css class I added in 1.0.0 that was removed in 2.0.0. Basically any details you think would be helpful for me would be great 🙂

    Sorry about the difficulties,
    Faison

    Thread Starter Nathan Hawkes

    (@natehawkes)

    Hi Faison,

    Version 1 seems to fix the issue, but that’s not the point for you as a developer. Here is my menu code in version 2 (sorry for the code being all over the place, I just did a direct copy and paste): http://pastebin.com/N3hETyMQ. With version 1, it’s http://pastebin.com/L1KHX0uG. Immediately, you can see the difference, not just because v1 is 100 lines longer than v2 (managing all of those pages is a pain in the derrière too). Many of the sub-menus are separate menus in WordPress, because it makes it easier to embed the menu into a page as needed.

    Originally, the menus were named using > as a separator so I could see where they went (eg. “Main > About“). Now they use |, but that makes no difference. Those Pastebins were taken just now, and the issue is still around.

    Plugin Author Faison

    (@faison)

    Hi natehawkes,

    I completely understand, I just wanted to provide you with a fast way to solve the problem on your site while work on the proper solution is under way.

    Those two pastebins help a lot. To make Navception work well with other Nav Menu plugins, I had to drastically change how the sub menus were added to the mix. You can see this in some of the menu item IDs: “menu-item-648-navception2” and “menu-item-414-navception2-4” for example.

    I did some exhaustive testing to make sure the changes were solid, but your experience shows that I missed something. I’ll need to recreate this in the next couple of days (sorry, works a bit full this week) so I just need to ask a couple of questions.

    I see that you have some submenus nested in other submenus. Does this go any deeper than 2 levels of nesting?
    Could you show me your call to wp_nav_menu for this menu?
    Do you know if you’re using a custom Nav Walker?

    That should help me get started on figuring out what’s happening here.

    Thanks,
    Faison

    Thread Starter Nathan Hawkes

    (@natehawkes)

    Hi Faison,

    I understand, and I am grateful. I just can’t help but think you must be scratching your head over what it could be and how whatever it is could have slipped through. It must be really frustrating.

    In answer to your questions, the menus only go two levels deep. That’s more because my CSS doesn’t go back on itself, so further levels will end up going off the page, so I stopped at two levels. Most of the pages don’t need more than two levels anyway.

    The wp_nav_menu call is just <?php wp_nav_menu(array('theme_location' => 'header-menu')); ?>. I don’t think I’m using a walker. I can’t see anything in my code, and I don’t know of any plugins that I am using that would be nav walkers. To be honest, I’d never even heard of a nav walker until you mentioned them, so I really doubt I’m using any.

    Here’s my fix:
    File navception.php, line# 146

    From
    $navception_item->menu_order .= $navception_suffix;

    to
    $navception_item->menu_order = ($item->menu_order * 100) + $navception_item->menu_order;

    However, the limitation of the code is, it supports less than 100 items per menu. Hopefully, this is plenty for everybody.

    Nicholas

    (@ncraig-thread)

    this is the closest question about navception i could find so i thought i would add it here.

    Navception breaks the new wordpress customizer but if you add this it gets around the bug
    navception.php line 102

    // Don't navcpetion in the customizer
    		global $wp_customize;
    		if (isset($wp_customize)) {
    			return $items;
    		}
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding sub-menus seems to break menu display’ is closed to new replies.