- This topic has 16 replies, 4 voices, and was last updated 6 years, 7 months ago by Tom.
-
AuthorPosts
-
May 18, 2017 at 5:48 am #319902Paul
Hi,
I’d like to disable the responsive toggle menus on tablet and mobile for both the primary and secondary navs.
I found the CSS recommended here but that has no effect – https://generatepress.com/forums/topic/disable-mobile-navigation/
I’m also aware there’s a plugin to disable the mobile features in GP but I only want to change the behaviou of the two menus.
Can you please advise?
Thanks,
Paul.May 18, 2017 at 9:34 am #320115LeoStaffCustomer SupportHi Paul,
That code should still work. Can you provide a link to your site where it’s not working?
Thanks!
May 18, 2017 at 10:47 am #320162PaulMay 18, 2017 at 10:51 am #320164LeoStaffCustomer SupportAh it was overwritten. Try this:
@media (max-width: 768px) { .menu-toggle { display: none !important; } }
Let me know.
May 18, 2017 at 10:59 am #320170PaulBelow the 768 breakpoint the primary, secondary nav, and content are not displayed.
May 18, 2017 at 11:21 am #320176LeoStaffCustomer SupportThe code shouldn’t hide your content.
I’m on my phone right now so can’t check but I seem to remember there was no contents added on desktop either?
May 18, 2017 at 12:15 pm #320217PaulI see. It’s the menu’s themselves that are hidden, not the content. I just wanted the menus to not apply the toggle.
May 18, 2017 at 12:19 pm #320228LeoStaffCustomer SupportSo basically you want both menus to show but with the same style on desktop and not in the mobile layout?
Wouldn’t the menu items be squeezed together like that?May 18, 2017 at 12:33 pm #320233PaulYeah that’s right. I only have two menu items on primary, and three on secondary.
May 18, 2017 at 1:54 pm #320278TomLead DeveloperLead DeveloperYou could do something like this:
@media (max-width:768px) { #site-navigation .menu-toggle, #site-navigation .mobile-bar-items { display: none; } #site-navigation ul { display: block; } #site-navigation .main-nav li { float: left; clear: none; } #site-navigation .main-nav ul ul { position: absolute; top: auto; width: 200px; } #site-navigation .main-nav ul ul ul { left: 100%; top: 0; } #site-navigation ul ul .dropdown-menu-toggle:before { content: "\f105" !important; } }
May 18, 2017 at 2:31 pm #320309PaulThanks Tom. Secondary menu remains toggled though.
May 18, 2017 at 2:36 pm #320312LeoStaffCustomer SupportMay 18, 2017 at 2:51 pm #320321PaulI would have liked to keep all menu items centered aligned too – primary isn’t on mobile. I’ll need to create a child theme to add custom functions. I don’t have that right now since this is just a sandbox install and I cancelled all hosting packages I had for now. I actually thought this would be done more easily since a Google search shows this was originally requested as early as 2015. Thanks for the suggestions though, if I have time to look into them I will.
May 18, 2017 at 6:59 pm #320384LeoStaffCustomer SupportYou don’t necessarily need a child theme to add that function.
Code Snippets should do: https://docs.generatepress.com/article/adding-php/#code-snippets
May 18, 2017 at 11:30 pm #320481TomLead DeveloperLead DeveloperThis should make your items centered:
@media (max-width:768px) { #site-navigation .menu-toggle, #site-navigation .mobile-bar-items { display: none; } #site-navigation ul { display: block; } #site-navigation .main-nav li { float: none; display: inline-block !important; clear: none; } #site-navigation .main-nav ul ul { position: absolute; top: auto; width: 200px; } #site-navigation .main-nav ul ul ul { left: 100%; top: 0; } #site-navigation ul ul .dropdown-menu-toggle:before { content: "\f105" !important; } }
-
AuthorPosts
- You must be logged in to reply to this topic.