title: Wordpress Walker — how to add number of post to category menu items?
body: <p>I wanted to add number of posts for menu items that are categories.
  For example:</p>
  
  <ol>
  <li>Category 1 (5)</li>
  <li>Category 2 (8)</li>
  <li>Category 3 (2)</li>
  </ol>
  
  <p>etc...</p>
  
  <p>I edit <strong>walker</strong>:</p>
  
  <p><em>get number:</em></p>
  
  <pre><code>$item_count = $depth == 0 ? get_posts( array(
    'post_type' =&gt; 'post',
    'numberposts' =&gt; -1,
    'orderby' =&gt; 'category',
    'order' =&gt; 'ASC'
  ) ) : false;
  </code></pre>
  
  <p><em>output:</em></p>
  
  <pre><code>$item_output .= $item_count ? ' &lt;span&gt;(' . count( $item_count ) . ')&lt;/span&gt;' : '';
  </code></pre>
  
  <p>The result is a postscript to each menu item the number of all posts.
  <strong>How to modify?</strong></p>