Is it possible to create a menu with a category such that each time that I had a sub category that automatically display on the menu?
As far as I know, if I have a menu with the category “fruit”, and I create the subcategory “bananas”, I have to manually add it.
This depends on what kind of menu you are talking about:
1)
If you are talking about “custom menus” (found in the Backend under Design -> Menus) you can do the following:
-
Create a new function with the action hook add_category
-
inside of this function, you can create a new post of type the menu
item type, which is added correctly to your menu
-
whenever a new category is published the menu item is added now
-
you should also hook into delete category, to keep your menu
up-to-date
2)
You could do much easier without a wordpress menu:
- just write a function to list your categories (or use the predefined
wp_list_categories
function)
- if this is not sufficient write a customized one which (maybe
recursivley) reads your categories from the database
For option 1 to code you require some knowledge about WordPress though.