walker count menu depth
-
can anyone point me in the right direction to find the number of submenus per menu item OR the max depth of submenus? I have looked into the $depth value in the class-wp-walker, nav-menu, and nav-menu-template but I am afraid I am having a hard time interpreting how to utilize it to my needs. Essentially, I am creating CSS based on menus but I am not sure how many submenus there will be (it can be changed) so I wanted to create a loop based on the max depth of the submenu (ie:
-
menu-item
- sub-menu-item
-
menu-item
- sub-menu-item
- sub-menu-item
The value here would be 2 (there is a submenu item under a submenu item).
Any thoughts would be appreciated.
The topic ‘walker count menu depth’ is closed to new replies.