I have three levels of my menu created in custom walker class. Output is like below:
- home (parent)
- about (parent)
- item 1 (level 1 child)
- item 1-1 (level 2 child)
- item 1-2 (level 2 child)
- item 1 (level 1 child)
- services (parent)
- item 1 (level 1 child)
- item 1-1 (level 2 child)
- item 1-2 (level 2 child)
- item 2 (level 1 child)
- item 2-1 (level 2 child)
- item 2-2 (level 2 child)
- item 1 (level 1 child)
I want to count only "level 1 childs" inside start_lvl() for each parent item individually.
In above example, output should be for about (1) and services (2) because "about" has only 1 child for level 1, and services has 2 childs for level 1
Please somebody help, I have searched a lot and tried almost all methods available on Stack Exchange, Overflow etc...