我想做一个与wp_list_categories
生成嵌套菜单的步骤ul
s使用我的类别、子类别和子类别(?)结构任何具有子类别的类别都不能是链接,因此可以单击它以显示子类别(或子类别)。
以下是我想要的(只有带有a的项目才应该是链接):
Tops
Shirts
T-shirts
Longsleeves
Jackets
Hoodies
Raincoats
Shoes
Boots
Formal
Trousers
Shorts
Longs
Bags
另请参见此CodePen demo with the hard-coded HTML I\'d like to generate, 理想情况下,使用定制助行器wp_list_categories
.我需要在一系列嵌套的ul
s、 如果给定类别有子类别,则该类别can\'t 显示为链接(adiv
或类似)我的菜单系统最多有三个层次,没有后代的类别可能在任何地方。我真正想使用的原因wp_list_categories
因此,我的编辑器可以灵活地重新排序类别。如果我在每个顶级类别中硬编码,他们就无法使用WP的内置类别编辑器对它们进行自由重新排序。
Goal: Right now, wp_list_categories
does output my categories properly. I just need to figure out how to override the code that is making category titles with subcategories be links. I need them to just be plain text.