admin管理员组文章数量:1122832
I've more than 450+ WooCommerce product categories and subcategories. I want to add them all in the menu items, categories as a top level menu and subcategories as submenu. Is there any way to automate the process?
I've more than 450+ WooCommerce product categories and subcategories. I want to add them all in the menu items, categories as a top level menu and subcategories as submenu. Is there any way to automate the process?
Share Improve this question asked Mar 6, 2020 at 18:16 shakibshakib 12 bronze badges1 Answer
Reset to default 0For menus this large, it's usually more efficient to use functions like wp_list_categories()
(which can also output custom taxonomies like Product Categories) in whatever theme template you need to affect. Bonus: your menu will always be current, because unlike a static WP Nav Menu, this will always pull all Product Categories and not need manual updating.
Keep in mind, it's not always a good user experience to have such massive menus to drill down through, and Google specifically recommends having less than 100 links per page - which includes all links, not just menus. So, you may be better off just listing top-level categories in your menu, and making sure you have a robust search feature, to help with SEO and UX.
本文标签: categoriesHow to add all subcategories as submenu in WordPress menu
版权声明:本文标题:categories - How to add all subcategories as submenu in WordPress menu 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736286589a1927700.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论