I'm working in my category navigation as a dropdown list. I want to be able to display the children and grandchildren of the parent category. The problem I'm having is that once I'm in the children page, it lists the children of that subcategory if there's any, if not then it will display "No categories." I want to always have the same navigation in all levels, so basically I want the parent's first level children to be listed in all levels.
The code I'm using is this:
wp_list_categories('title_li=&order=DESC&child_of='. $cat);
And it returns this list on parent page:
Children #1 (1st level)
Children #2 (1st level)
- Grandchildren#1 (2nd level)
--- Grandchildren#1(3th level)
- Grandchildren#2 (2nd level)
Children #3 (1st level)
Children #4 (1st level)
If I'm in Children #2 (1st level) returns this list:
Grandchildren#1 (2nd level)
- Grandchildren#1(3th level)
Grandchildren#2 (2nd level)
Then it returns this list on Children #3 (1st level):
No Categories
I want to be able to display the list that's on the parent level category in all of its children category.
Can someone help me out with this, I have looked all around for days and haven't been able to find something that works, some codes out there require the category ID but I want to use this in all of my categories.