Assign Custom Menu for Mobile

Posted in: Newsmag
Post count: 6

I want to assign a different WP menu to the mobile menu instead of the default main menu.

I have registered a new nav menu location in my child-theme functions and assigned my new menu to the location. I copied /parts/mobile-menu.php to my child theme and edited ‘theme_location’ to my new menu location name.

This works in that it shows my new mobile menu in the mobile view, but at the same time it breaks the main menu’s mega menu features.

Any advice? Thanks.

Post count: 6600

Hi,

I’m not sure about this could you please send a screenshot to also see how the mega menu breaks or provide you site’s url.
Please let me know!

Thanks

Post count: 6

thanks for the reply. I can’t share my url, here are screenshots

before – menu works (its loading in page content in this screen shot)

https://dl.dropboxusercontent.com/u/41174/Screen%20Shot%202015-01-29%20at%209.53.48%20AM.jpg

after setting theme_location to my custom_menu in /menu-mobile.php – mobile menu changes as desired but main nav mega menu dropdowns do not load (and are not being output in the html code), and other stuff like the padding doesn’t seem to apply.

https://dl.dropboxusercontent.com/u/41174/Screen%20Shot%202015-01-29%20at%209.54.51%20AM.jpg
https://dl.dropboxusercontent.com/u/41174/Screen%20Shot%202015-01-29%20at%209.57.04%20AM.jpg

Post count: 6600

Hi,

I have investigated this and seems that the mega menu feature it bound by the header menu id that is why the menu breaks, changing it is not simple and you would need additional customization besides changing the menu id.
You could try to add menu items for both you menu then use css to hide the ones you want only on mobiles on desktop and reverse.
Sorry for the inconvenience!

Thanks

Post count: 26

I have the exact same problem. I am working on it and will share here if I figure anything out.

Post count: 26

In case someone need this, here is the easy full steps for a separate mobile menu.

(line number for NewsMag theme v1.5)

1) themedir \parts\menu-mobile.php
Line 18 change to 'theme_location' => 'mobile-menu',

2) themedir \includes\wp_booster\td_menu.php
Line 9 change to var $is_header_menu_mobile = false;
@wishdigital: you just need to modify here.

3) same file as 2)
Line 235 add this line 'mobile-menu' => 'Mobile Menu',
before 'footer-menu' => 'Footer Menu'

That’s it. Of course you need to create a new menu for the “Mobile menu”.

Hope this help.

Post count: 6

You sir are a scholar and a gentleman.

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newsmag’ is closed to new topics and replies.