Support » Plugin: Query Multiple Taxonomies » [Plugin: Query Multiple Taxonomies] show number of posts

  • Hello Scribu!
    Thanks fo trh perfect plugin!
    Tried to search for an answer, but in vain, so desided to ask here.
    I would like to show a number of posts im () just after or before + sign.
    E.g. Category name (+) (7) or Tag name (+) (12)
    In ordinary category widget this option can be choosen in the admin part.
    Is it possible to do within your Query Multiple Taxonomies plugin widget?

    Thank you in advance for your answer!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author scribu

    (@scribu)

    It’s possible, but with a lot of extra SQL queries.

    Don’t you plan to add this option to your plugin updates?

    I suppose it can be done using this code but for each category:

    foreach (get_categories(array('hide_empty'=>false)) as $category)
    			{
    			$getcatnum = $category->count;
    			}

    question is how to adopt it for custom taxonomies?
    I was trying to use this:
    wp_list_categories('echo=0&show_count=1&title_li=&taxonomy=districts');
    and this:

    foreach (get_categories('taxonomy=districts') as $category)
    {
    $getcatname = $category->name;
    
    echo ''. $category->count .' '.$getcatname.' get cat style';
    
    }

    “districst” – are one of the taxonomy
    how to use this withing the plugin?
    And how to be with tags in same way?

    Plugin Author scribu

    (@scribu)

    You can use get_terms() instead of get_categories().

    However, that count represents the total number of associated posts, not the number you would find if you filter by that term, and others.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Query Multiple Taxonomies] show number of posts’ is closed to new replies.