Ready to get started?Download WordPress


[resolved] Display same menu for parent and all its children (2 posts)

  1. tstrebeck
    Posted 11 months ago #

    I posted this yesterday, but I think this is a better way of wording what I'm wanting to accomplish...

    I have three main directories in my site, and I'm wanting to display one unique menu for each directory and display it on each child of that directory. I'm thinking I create my three custom menus, but then what would be the best way to display the correct one for each section?

    Thanks for your help!

  2. samcrawshaw
    Posted 11 months ago #

    Not sure if I get you, but something akin to this?

    if (is_page('your_page_name')){
    wp_nav_menu(array('menu' => 'your_menu_name',
    'container' => false,
    'items_wrap' => '<ul id="%1$s" class="%2$s"><h4>Menu Name</h4>%3$s</ul>'));}
    else if{arguments for another menu}
    else if{arguments for another menu}
    else{what to do otherwise}


You must log in to post.

About this Topic


No tags yet.