In WordPress, i’d like to automatically add categories from custom post types in a submenu item, with respecting the hierarchy.
This is how my menu will look like:
- Projects
- Categories
- Category 1
- Category 2
- Subcategory1
- Subcategory2
- Category 3
- ….
- Other Sub item
- ItemX
- ItemY
- Categories
Any idea on how to automatically add all categories in the menu, under “Categories” item?
(It’s a menu created in Appearance > Menus)
I guess i might use wp_list_categories() but I have no idea where to place this…
Thanks !
Try this filter
It’s a little hacky but i managed to add some stuff into my menus from here
WP nav menu itmes