How to gain access to each menu item in wordpress?

I have some menu items in a menu at location “main-menu”.
By using wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); , i get all the 13 items in a div.

Now i just need to show 10 menu items in present div and the remanining in other div (say id=”new”) just adjacent to it. Again if the div with id “new” has 10 menu-items in it, again a new div will be created and the remaining items are shown in it.

So is there a way to access the array that contains these menu-items?
Please help.

2 Answers
2

Besides a custom walker, you could also use a filter, such as wp_nav_menu_args or wp_nav_menu_objects as described in the codex

Leave a Comment