Support » Plugin: Query Multiple Taxonomies » [Plugin: Query Multiple Taxonomies] Hide cats who have no posts nor posts in child cats?

  • Resolved dannyjimmy



    I found it visually cluttered when I’m looking at a category tree full of Category1 (0) (+)
    Category2 (0) (+)
    Category3 (0) (+)
    Category4 (0) (+)
    Category5 (3) (-)

    As a workaround, I:
    1. Added count{{count}} as a class in the li in the mustache template file you provide
    2. Added count0 {display:none !important;} to my theme’s CSS file.
    3. Assured that all posts in subcategories were also added to parent category. (Otherwise I would hide empty parent categories of very full subcategories, and the child is hidden along with the parent.)

    This basically works, unless I didn’t want to have posts in child cats also be in parent cats. So the feature request would be:

    If neither the category nor any of its children contains any posts, the category is not displayed in the list view.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Weird, mine already hides empty categories. I believe that is a setting you have defined when you created your custom taxonomy.

    +1 on problem.. waiting for proper solution

    thanks! your idea saved me a lot!

    at the count function in walkers.php,
    i fixed this line (58,59)

    'include_children' => 0,
    'operator' => 'AND'


    'include_children' => true,
    'operator' => 'IN'

    counts of parent terms will include their child terms count.
    it works with me.

    Plugin Author scribu


    @dannyjimmy: As Jason said, empty terms are already hidden by default.

    @wxyjp: That seems to work well. Commited to the latest development version (1.6.3-alpha). Thanks for sharing!

    Gotcha. So perhaps I only THOUGHT they were empty, because child-cat-counts weren’t included? Either way, seems like this won’t be a problem any more starting wit 1.6.3.

    @scribu I have to compliment you on the progress of this plugin; the last update really did wonders and it seems you’re still working away to make it better. The work is appreciated.

    I’m still having issues with this, not sure what’s going on.

    I’m using the List option in the Widget.

    I tried what @wxyjp posted, but didn’t seem to resolve anything besides changing quantity for categories, even when it didn’t exist.

    I also deactivated all my other plugins with no luck.

    Any ideas?

    @arudd: I had a similar problem. Are you listing categories and taxonomies in custom post type archive page? If so, you may need to designate your post type. Try this fix to the core.php.

    core.php line 107-111

    $query_vars = array_merge( $query_vars, array(
    	'fields' => 'ids',
    	'qmt_count' => true,
    	'nopaging' => true
    ) );


    $query_vars = array_merge( $query_vars, array(
    	'fields' => 'ids',
    	'qmt_count' => true,
    	'nopaging' => true,
    	'post_type' => get_post_type()
    ) );

    All my posts are category based, using the default category.php page, and using get_template_part based on category chosen.

    I haven’t made sense of it yet… thank you for your help, and unfortunately, the information above does not help me.

    Just hide with jquery that’s what I did:

    // Remove Empty filter options
    jQuery("#sidebar .term-item a:contains('(0)')").closest('li').remove();

    this fix

    not work whith me, wordpress convert ‘+’ to ‘%2B’
    test request

    +1 on this issue.
    Hide TAGS but not the CATEGORIES.

    I’m Using List win Widget.

    So what IS the resolution here? I have Version: 1.6.2

    All of the terms and counts show up for me (empty or not). I’m currently using the list mode but the empties show up in all modes.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: Query Multiple Taxonomies] Hide cats who have no posts nor posts in child cats?’ is closed to new replies.