Remove sub items on moblile
-
Hello WP Community,
On mobile, the menu opens up everything, including sub nav items. Is it possible to just see the top nav items on mobile with CSS? Thanks. -John
The blog I need help with is: (visible only to logged in users)
-
Hi there,
Unfortunately that theme appears to remove any selectors when using the mobile menu so it’s hard to specify the sub nav items in particular. I did figure out a workaround, but it is dependent on the placement of the items. If you shift around your menu order, you’ll have different things appearing and disappearing (but it shouldn’t be too hard to modify the code below if there are updates):
.dk_options_inner li:nth-child(4), .dk_options_inner li:nth-child(5), .dk_options_inner li:nth-child(9), .dk_options_inner li:nth-child(10), .dk_options_inner li:nth-child(12), .dk_options_inner li:nth-child(13) { display: none; }Hope that helps!
Sage -
-
-
Hi Sage-
Again, thanks for the solution-to the mobile menu expansion. I’ve learned a lot and shared this with the person I’m working with.
If possible, would you take another look? Now, none of the sub menu items will show even when the parent menu is selected.
The Cause?
Since the parent menu item needed to be nulled (so only the sub menu items were clickable), I gave the parent items a “#” link. But since we’ve prevented the automatic expansion on mobile, the sub menu items are now not showing at all.Thanks!
The Site: johnwtaylordesign.wordpress.com.
-
Hi there!
Unfortunately the way the menu code is set up it makes it so that it can’t be made collapsable or openable on mobile. The items have to either be there or not :/
Sorry about that,
Sage
- The topic ‘Remove sub items on moblile’ is closed to new replies.