WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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

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

   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
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 '14 at 13:56

Your Answer


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.