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 4 menus (submenus) in wordpress. I need to know how show this menus only if pages ids are "10 and 11 for example. Is possible? I'm desperated after two hours... thanks!

This is my code for one of them:

<?php if( has_nav_menu( 'smone-menu', 'responsive' ) ) { ?>
        <?php wp_nav_menu( array(
                               'container'      => '',
                               'menu_class'     => 'smone-menu',
                               'theme_location' => 'smone-menu'

    <?php } ?>
share|improve this question
up vote 1 down vote accepted

Have you tried adding the is_page() conditional like this:

if( has_nav_menu( 'smone-menu', 'responsive' ) && is_page(array( 10,11 ))) {
share|improve this answer
let me test... thanks! – Vektor Unbreakable Jul 27 '14 at 22:04
I'm assuming these are pages and not post I.D's you provided? – Brad Dalton Jul 27 '14 at 22:06
very thanks!!! you assuming correctly. xD – Vektor Unbreakable Jul 27 '14 at 22:16

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.