WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. tstrebeck
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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}

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.