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 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

1 Answer 1

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 at 22:04
    
I'm assuming these are pages and not post I.D's you provided? –  Brad Dalton Jul 27 at 22:06
    
very thanks!!! you assuming correctly. xD –  Vektor Unbreakable Jul 27 at 22:16

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.