Eujomnoma
Eujomnoma

Reputation: 57

How to hide main menu while showing sub-menu in css

I'm creating a side-bar menu for a site, which should only show sub-menus in a currently selected page. The site is in wordpress. I have managed to hide inactive sub-menu items for pages that are not selected using this css:

    .sub-menu { display: none; }
    .current_page_item .sub-menu, .current_page_parent .sub-menu { display: block;}

But how can I hide the main menu items but still display their sub-menus? Here's a link to the site NOTE: I want to hide ALL the main menu items so that I only have the sub-menus

Help would be much appreciated!

Upvotes: 0

Views: 1527

Answers (1)

Brian Flanagan
Brian Flanagan

Reputation: 4642

This will hide the current item anchor.

.current_page_item > a {display:none;}

(You may want to adjust the left margin on the sub items depending on the look you're going for.)

Upvotes: 2

Related Questions