It is possible to show subcategories of parent categories in Wordpress.
However, I have the need to show just parent categories, and then to display subcategories when the user clicks on the parent.
Let's say I have category A and B. In A I have A1, A2 and A3. In B B1 and B2. Now I would like to show the categories on the frontend... something like:
Category A:
Category B:
When the user clicks on Category A, I want the following to occur:
Category A
- A1
- A2
- A3
Category B
When the user clicks Category B, I want the following to occur:
Category A
Category B
- B1
- B2
Does anyone know if this is possible please? If so, could you add some pseudo code that may help me understand please?