WordPress.org

Ready to get started?Download WordPress

Forums

Show specific menu item from wp_nav_menu based on id (2 posts)

  1. heavymark
    Member
    Posted 3 years ago #

    I have a wp_nav_menu "Main Menu"such as the following:

    Top Level (#menu-item-1)
    -Sub Item
    -Sub Item
    Top Level (#menu-item-2)
    -Sub Item
    Top Level (#menu-item-3)
    -Sub Item A
    -Sub Item B
    -Sub Item C

    Then in my template I want to be able to echo wp_nav_menu Main Menu sub items for say top level with id of menu-item-3.

    So something like this: (but that would actually work of course)
    wp_nav_menu( array('menu' => 'Main Menu' 'menu-item-id' => '3' ));

    And that would return:

    <ul>
    <li>Sub Item A</li>
    <li>Sub Item B</li>
    <li>Sub Item C</li>
    </ul>

    If it matters this is so I can show the sub items as side menu interior based on which main menu item section your in dynamically. Thanks in advance!

  2. heavymark
    Member
    Posted 3 years ago #

    Bueller? Bueller? =)

Topic Closed

This topic has been closed to new replies.

About this Topic