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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -