This simple snippet of code either added as a plugin or in your themes functions.php script will do the following:
(1) Always show a category on the widget even if no posts in that category
(2) If child categories exist only displays on the widget the category of the current selected parent category.
Note: To make it easier to flow and to improve search engines, might also be worth adding breadcrumb navigation too.
function dunnies_wp_list_categories($cat_args){ $this_cat = (get_query_var('cat')) ? get_query_var('cat') : 0; $cat_args['child_of']=$this_cat; $cat_args['depth']=1; $cat_args['hide_empty']=0; return $cat_args; } add_filter('widget_categories_args', 'dunnies_wp_list_categories', 10, 2);
Hope this helps someone.