• Hi.

    I run the website https://www.sedonarecycles.org and am pretty much a complete novice. We are running Virtue theme and everything is current. We would like to create a sort of website within a website for our education section. Right now, “Education” is a menu item in the “blocks” menu. I have created child pages under the parent page Education that are not yet published.

    Here’s what I would like:
    When you click on Education in the blocks menu and go to the Education page, I would like the blocks menu to change completely so it displays the Education parent and child pages in place of the menu present on the rest of the website. This separate Education menu would be visible on the Education parent and child pages only.

    I have created a new menu that includes the child pages. Now the hard part. How do I actually get this menu to appear as I would like? Someone suggested I use the following code:

    //Pretend the Education page ID is 5
    if ( is_tree( 5 ) ) {
    wp_nav_menu( … ); //the 3rd "education menu parameters"
    } else {
    wp_nav_menu( … ); //Whatever you have now.
    }

    Will this work for what I want to do? And if so, where do I put this code? I have done very little coding on the website and have to be completely walked through it, so I don’t know where to put this code to make it work. I look at the suggested code and have no idea what to do, other than putting in the right page ID.

    Thanks for your help!
    Meghan

  • The topic ‘Display different menu for all pages under one parent’ is closed to new replies.