Current category children – conditional display
-
Hi !
I have this code in my sidebar.php template:$cat_ID = get_query_var('cat'); echo '<ul>'; wp_list_categories('title_li&hide_empty=0&child_of='.$cat_ID); echo '</ul>';
which is showing children categories of current category.
What I would like is to show children categories when there are any, but when there aren’t any child, to leave it blank and. Or anything else but “No categories” (this is the result of wp_list_categories function).
I suppose some kind of if/else condition will solve that.
I haven’t been able to make the solution so far …Any ideas, please ?
Thnx
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Current category children – conditional display’ is closed to new replies.