php - Wordpress nav walker to count sub-menus -
in wordpress menu, need add class parent <li>
when has 3 levels (when parent's sub-menu has sub-menu). in other words:
<ul> <li>parent <ul class="sub-menu"> <li>sublink1</li> <li>sublink2</li> </ul> </li> <li>parent</li> <li class="mega">parent <!-- add class here b/c has 3 levels --> <ul class="sub-menu"> <li>sublink1</li> <li>sublink2</li> <li>sublink3 <ul class="sub-menu"> <li>sublink1</li> <li>sublink2</li> </ul> </li> </ul> </li> <li>parent</li> <li>parent</li> <li>parent <ul class="sub-menu"> <li>sublink1</li> <li>sublink2</li> </ul> </li> </ul>
i'm sure need use walker achieve this, haven't been able find example of 1 this. thank you!
Comments
Post a Comment