Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have created one menu and have some sub-menu but I don't want to display any sub-menu from my template.

My Menu code:

<?php wp_nav_menu( array('menu' => 'header-uk', 'menu_id' => 'nav', 'menu_class' => 'sitemap', 'fallback_cb' => false) ); ?>

My Menu Screenshot:

enter image description here

I want to display only this menu in my template:

Awards
Sagres Town
Getting Here
Sister Hotels
Other
Work for Martinhal
Disclaimer
Site Map
share|improve this question

2 Answers 2

It's a CSS trick, not related to WordPress I guess. BTW you can do something like this:

ul.sitemap{
   list-style-type: none;
   margin: 0;
   padding: 0;
}

ul.sitemap li{
   margin: 0;
   padding: 0;
}

As you've declared the 'menu_class' => 'sitemap' the <ul> will get a class .sitemap that's why we are targeting that class to put our CSS.

share|improve this answer

You'll need to set the depth parameter in the wp_nav_menu arguments

share|improve this answer
1  
Could you please add the actual solution(code)? It really is easy in this case. Also have a look at Provide context for links –  kraftner May 5 at 13:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.