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.
Besides a custom walker, you could also use a filter, such as
wp_nav_menu_args
orwp_nav_menu_objects
as described in the codexI belive you can extend Walker_Nav_Menu class to use it for your proposes. In this example important a custom_menu_walker element which is your custom walker class.
custom_menu_walker
this isn’t an code for your question, just a small example
You can read a more about custom walkers at codex and here on wpse (1,2)