Mega Menu disappeared and won’t come back
-
We use Mega Menu for our desktop menu at Peer Unschooling Network. The other day, I was testing an issue with our theme. I switched the theme over to Twenty Nineteen, and then switched back to our main theme (a child theme of WPeddit). When I switched back, our menu stopped working. It is completely absent from the page. No idea how or why.
The page I need help with: [log in to see the link]
-
Hi flantascience,
How did you previously add the menu to the page? Using a standard call to wp_nav_menu, or are you using a page builder?
Regards,
TomI’m not sure. The developer who set it up has disappeared.
There are two menu plugins we use, one for the desktop and one for the mobile menu. The theme we’re using has a really bad menu, so we don’t use it at all.
The mobile menu is working fine, that uses “Responsive Menu”: https://www.ads-software.com/plugins/responsive-menu/
The desktop menu is the one using Mega Menu.
I don’t see anything inside of our child theme folder in functions.php or header.php which mentions wp_nav_menu. We do have a page builder (Beaver Builder) but I don’t think that was used to setup the menu.
Also I see this code seems to be the closest related to the menu inside of header.php:
<div class="jtmobmenu jthead"><?php if ( function_exists('has_nav_menu') && has_nav_menu('mobile-menu') ) { wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav mobile-menu', 'theme_location' => 'mobile-menu' ) ); } ?></div>
And then it looks like this is the HTML code generated for the menu. (Keep in mind the URLs are a little off because I am pulling this from the Internet Archive of an old version of the page when the menu worked)
<div class="jtmobmenu jthead"><div id="mega-menu-wrap-mobile-menu" class="mega-menu-wrap"><div class="mega-menu-toggle"><div class="mega-toggle-blocks-left"></div><div class="mega-toggle-blocks-center"></div><div class="mega-toggle-blocks-right"><div class="mega-toggle-block mega-menu-toggle-block mega-toggle-block-1" id="mega-toggle-block-1" tabindex="0"><span class="mega-toggle-label" role="button" aria-expanded="false"><span class="mega-toggle-label-closed">MENU</span><span class="mega-toggle-label-open">MENU</span></span></div></div></div><ul id="mega-menu-mobile-menu" class="mega-menu max-mega-menu mega-menu-horizontal mega-no-js" data-event="hover_intent" data-effect="fade_up" data-effect-speed="400" data-effect-mobile="disabled" data-effect-speed-mobile="200" data-mobile-force-width="false" data-second-click="close" data-document-click="collapse" data-vertical-behaviour="standard" data-breakpoint="600" data-unbind="true"><li class="mega-menu-item mega-menu-item-type-custom mega-menu-item-object-custom mega-menu-item-has-children mega-align-bottom-left mega-menu-flyout mega-menu-item-3059" id="mega-menu-item-3059"><a class="mega-menu-link" href="#" aria-haspopup="true" aria-expanded="false" tabindex="0">Social<span class="mega-indicator"></span></a><ul class="mega-sub-menu"><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-106" id="mega-menu-item-106"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/chat/">Chat</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-340" id="mega-menu-item-340"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/friend-finder/">FriendFinder</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-176" id="mega-menu-item-176"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/discussions/">Bulletin</a></li></ul></li><li class="mega-menu-item mega-menu-item-type-custom mega-menu-item-object-custom mega-menu-item-has-children mega-align-bottom-left mega-menu-flyout mega-menu-item-3058" id="mega-menu-item-3058"><a class="mega-menu-link" href="#" aria-haspopup="true" aria-expanded="false" tabindex="0">Media<span class="mega-indicator"></span></a><ul class="mega-sub-menu"><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-555" id="mega-menu-item-555"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/video-submissions/">Theater</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-558" id="mega-menu-item-558"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/audio-submissions/">Radio</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-452" id="mega-menu-item-452"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/gallery/">Gallery</a></li></ul></li><li class="mega-menu-item mega-menu-item-type-custom mega-menu-item-object-custom mega-menu-item-has-children mega-align-bottom-left mega-menu-flyout mega-menu-item-3181" id="mega-menu-item-3181"><a class="mega-menu-link" href="#" aria-haspopup="true" aria-expanded="false" tabindex="0">Library<span class="mega-indicator"></span></a><ul class="mega-sub-menu"><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-3184" id="mega-menu-item-3184"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/book-library/">Books</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-3183" id="mega-menu-item-3183"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/video-library/">Videos</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-3182" id="mega-menu-item-3182"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/audio-library/">Podcasts</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-3224" id="mega-menu-item-3224"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/sde-meme-library/">Memes</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-3588" id="mega-menu-item-3588"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/sde-articles-library/">Articles</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-3586" id="mega-menu-item-3586"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/sde-learning-centers-library/">Learning Centers</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-3587" id="mega-menu-item-3587"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/sde-organizations-library/">Organizations</a></li></ul></li><li class="mega-rightside mega-login-reg mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-align-bottom-left mega-menu-flyout mega-menu-item-353" id="mega-menu-item-353"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/pun-login/" tabindex="0">Login</a></li><li class="mega-rightside mega-login-reg mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-align-bottom-left mega-menu-flyout mega-menu-item-352" id="mega-menu-item-352"><a class="mega-menu-link" href="https://web.archive.org/web/20190530143703/https://peerunschooling.net/register/" tabindex="0">Register</a></li></ul></div>
I also see this inside of functions.php but I believe this is for the ‘mobile’ menu:
/* Adds the Mobile Menu*/ function wdm_register_mobile_menu() { add_theme_support( 'nav-menus' ); register_nav_menus( array('mobile-menu' => __( 'Mobile Menu', 'wdm' )) ); } add_action( 'init', 'wdm_register_mobile_menu', 100 );
Hi flantascience,
Thanks.
Can you paste a screenshot of what you see under Mega Menu > Menu Locations?
Hopefully you will see a primary menu, and if you expand it you will find the PHP code to display the menu (this is no different from the standard PHP code used to display any WordPress menu, it’s just there for convenience). You will need to add that to your header.php file to output the menu.
Regards,
TomThere is some similar code that is already in my header.php file:
<div id="header-bottom-left"> <div class="logo jthead"><a href="<?php echo home_url();?>"><img class='logo' src='<?php echo of_get_option('main_logo'); ?>'/></a></div> <div class="jtmobmenu jthead"><?php if ( function_exists('has_nav_menu') && has_nav_menu('mobile-menu') ) { wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav mobile-menu', 'theme_location' => 'mobile-menu' ) ); } ?></div> <?php if(!is_user_logged_in()) { ?>
Here is a screenshot of what I see on Mega Menu -> Menu Locations:
https://snipboard.io/KjT5Bn.jpgHi Flanta,
I’m just guessing really, as I have no knowledge of how your site was originally coded, but maybe try pasting this code:
https://screencast.com/t/DBcRqxPF5
.. into your header.php file, and see if the menu gets output.
Otherwise it may be best to restore a backup from when it was working, or contact the original developer to see if they can take a look. I suspect they should have a copy of the site locally, maybe they can send you the header.php file.
Regards,
TomI added your code…. the menu does show up. But its not styled correctly on desktop. And it’s supposed to be completely hidden on mobile.
Hi Flanta,
Please check this page for details on how to hide the mobile menu:
https://www.megamenu.com/documentation/hide-mobile-menu/
You can change the styling of the menu using the theme editor. I see you’re using a caching plugin of some sort, so be sure to clear that cache after making any changes to the menu theme.
Regards,
Tom
- The topic ‘Mega Menu disappeared and won’t come back’ is closed to new replies.