admin管理员组文章数量:1414934
looking and trying for hours to find a solution for the following output of a wordpress custom menu. Hope you can help. I do not know where to start: custom menu walker, css, functions.php
I have a custom menu with "individual links" (so no pages or posts or categories) with Link and Link-Text. Right now depth is 5 (could be 6,7.. in the future).
Example menu:
Sport
Bike
Bikeparts
Seats
Mountainbike
Roadbike
Breaks
Break Levers
Adapters
Bike Add Ons
Bottle Holder
Water
Stand Up Paddling
Paddel
Boards
Air
Wingsuits
Automotive
car
motorbike
Tools
What should it be: See following scenarios: Default View on main page (depth 0):
Sport
Automotive
Tools
Click on "Sport":
Sport (bold)
Bike
Water
Air
Automotive
Tools
Click on "Bike":
Sport (bold)
Bike (bold)
Bikeparts
Bike Add Ons
Water
Air
Automotive
Tools
Click on "Bikeparts":
Sport (bold)
Bike (bold)
Bikeparts (bold)
Seats
Breaks
Bike Add Ons
Automotive
Tools
Click on "Breaks":
Sport (bold)
Bike (bold)
Bikeparts (bold)
Seats
Breaks (bold)
Break Levers
Adapters
Automotive
Tools
Click on "Break Levers":
Sport (bold)
Bike (bold)
Bikeparts (bold)
Breaks (bold)
Break Levers (bold)
Adapters
Automotive
Tools
So you see from Depth 1 if you start depth at 0 (step: click on Bike) and deeper you will always see all depth 0 menu items (sport, automotive, Tools), all siblings from this active menu item (bike) under active parent (sport) and all children of active menu item (bike).
What i have right now is the solution from / where i replaced:
} else if ( ! ( isset( $args->show_parent ) && in_array( $item->ID, $menu_item_parents ) ) ) {
with
} else if ( ! empty( $item->menu_item_parent ) ) {
So right now it works only with the first level. if i click on sport i do not see submenu from automotive.
I hope anybody can help.
Thanks in advance
本文标签: walkerwordpress custom menushow parentssiblingschildren depending on depth
版权声明:本文标题:walker - wordpress custom menu - show parents, siblings, children depending on depth 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745174968a2646191.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论