Viewing 7 replies - 1 through 7 (of 7 total)
  • you may want to wrap submenu with a conditional check:

    if (is_page( ID )) {
     submenu-code;
    }

    <?php if(is_page('our-work')) { ?>
    Show me the menu
    <?php } else { ?>
    Don't show me the menu
    <?php } ?>
    Thread Starter jaeeun

    (@jaeeun)

    Thanks. I assume that in ( ID ) I put the ID of the page that I want to show the submenu, and put the code in in functions.php? Do I need to replace “submenu-code” with some number, or just put it as it is?

    yes ID of ‘our work’..

    in page.php you will find the code which displays the submenu in it.. just wrap that code with the if statement..

    Note: work wit child themes to be safer..

    Thread Starter jaeeun

    (@jaeeun)

    Is it this code:

    <?php wp_nav_menu('title_li=&sort_column=menu_order&depth=2') ?>

    Thread Starter jaeeun

    (@jaeeun)

    I can’t find any other code in page.php…

    oh ok.. then replace above code with this:

    <?php
    if ( is_page( ID ) ) {
      wp_nav_menu('title_li=&sort_column=menu_order&depth=2');
    } else {
      wp_nav_menu('title_li=&sort_column=menu_order&depth=1')
    } ?>

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to Make Submenu Show Only in Certain Page’ is closed to new replies.