Reputation: 70
I have created some menus in wordpress backend. But now want to hide the menus at the forntend. Is there any way to hide the menus instead of removing at backend?
Upvotes: 0
Views: 1028
Reputation: 380
I'm a bit confused - are you talking about having (for example) a menu that has children, and you want to hide the children (and have them show up later)? And you want to pick and choose what's shown or not?
I get around this by making sure "CSS Classes" is checked (under "Screen Options" - it's unchecked by default) which adds a CSS Class field to all menu items. Then I add a class like "hide", and in my CSS I have .hide { display:none !important; } All you have to do from there is add the class to the specific manu items you want to hide (if that menu item has children, they'll be hidden, as well)
Is that what you're looking to have done? (I'm sorry if I'm answering the wrong question, but your original one isn't very clear to me. Could be the lack of coffee this morning :) )
Upvotes: 0
Reputation: 176
As wordpress provides customization for menu creation, so it assign a dynamic ids to individual menu items and it can't be fixed. So you can not hide/remove particular menu item programmatically.
Upvotes: 1
Reputation: 1708
Create CSS rule to hide the menu items you don't want.
Usually each of the items of the menu has an ID like id="menu-item-31".
Find out the IDs of the items you want to hide, and create a CSS rule like:
#menu-item-31 { display:none }
Hope it helps.
Cheers
Upvotes: 0