The Wordpress main menu item appears out of nowhere for the mobile version

advertisements

I've been asked to look at the main menu on luxmux.com, This is a Wordpress website, it has full and mobile version and the menu is different for both. For full version the menu works well and shows all the items as per Wordpress Dashboard>>Appearance>>Menu. For the mobile version however the menu adds a "- MENU -" item to the menu (to the very top). I've been asked to remove this item.

From what I see the menu is generated in header.php with this single line -

<?php wp_nav_menu( array( 'menu_id'=>'nav', 'theme_location'=>'main-navigation')); ?>

Initially I thought that I can remove a single item by using exclude, as per this example - wp_nav_menu exclude pages from menu

However, the "- MENU -" item does not have a page ID.

Thanks.


The reason that's happening is that Javascript is building the menu based on the main menu. Look at the selectnav.js file:

view-source:http://www.luxmux.com/wp-content/themes/shootingstar/js/selectnav.js?ver=0.1

Look into that file and you can see label = o.label || "- MENU -",

You'll have to know some JS to fix this issue.