title: wordpress get_categories count also custom post type
body: <p>on my home page i want to present how many posts are for each category. so i use get_categories->count for that. but i have a news custom post type. each news item is associated with a category. so how can i exclude the custom post type from the count?</p>
  
  <p>here is the code i have:</p>
  
  <pre><code>$args = array(
      'type'  =&gt; 'post',
      'child_of'  =&gt; 0,
      'parent'  =&gt; '',
      'orderby'  =&gt; 'name',
      'order'  =&gt; 'ASC',
      'hide_empty'  =&gt; 0,
      'hierarchical' =&gt; 1,
      'exclude' =&gt; array(1,8),
      'include' =&gt; '',
      'number' =&gt; '',
      'taxonomy'  =&gt; array('category'),
      'pad_counts' =&gt; true
    );
  $categories = get_categories( $args );
  </code></pre>
  
  <p>then i use within the loop: echo $category->count</p>