WordPress.org

Ready to get started?Download WordPress

Forums

help with wp_nav_menu to output as a simple array (1 post)

  1. cannon303
    Member
    Posted 3 years ago #

    Hi I'm going round and round in circles trying to create a hierarchical multi-tiered menu only showing sub menus when you are in the relevant section of the website.

    I'm using the menu interface in wp-admin as this is a great visual approach for my clients to organize menus, sub menus and sub sub menus. I can easily create the menu tree here.

    The problem that I've got is outputting that menu at the front end. Using wp_nav_menu and it's associated arguments doesn't give me any scope to show the menu and nest only sub menus when you are in that particular section.

    Unless someone has a great tutorial, plugin, hack etc that will help then I basically need to create something from the ground up so can anyone tell me how to output a basic array from wp_nav_menu something like this:

    $navArray = array();
    $navArray[0] = "item 1";
    $navArray[1] = "item 2";
    $navArray[1][0] = "item 2 sub 1";
    $navArray[1][1] = "item 2 sub 2";
    $navArray[2] = "item 3";
    $navArray[3] = "item 4";
    $navArray[4] = "item 5";
    $navArray[4][0] = "item 5 sub 1";
    $navArray[4][1] = "item 5 sub 2";
    $navArray[4][1][0] = "item 5 sub 2 sub sub 1";
    $navArray[4][1][1] = "item 5 sub 2 sub sub 2";
    $navArray[5] = "item 6";
    $navArray[6] = "item 7";

    The above array isn't correct but it's just a visual idea of what I want
    HELP!!!!!!!!!

    TA.

Topic Closed

This topic has been closed to new replies.

About this Topic