title: WordPress get_post_count?
body: <p>I'd like to create a function that retrieves the post count for a given query. I don't want to use get_posts obviously as its way to expensive for this purpose. However, that's exactly what I'm having to use in absense of a get_post_count function.</p>
  
  <p>My code is...</p>
  
  <pre><code>global $post;
  $cat=get_cat_ID('mymenu');
  $catHidden=get_cat_ID('hidden');
  $myrecentposts = get_posts(array('post_not_in' =&gt; get_option('sticky_posts'), 'cat' =&gt; "-$cat,-$catHidden",'showposts' =&gt; $NumberOfPostsToShow));
  $myrecentposts2 = get_posts(array('post_not_in' =&gt; get_option('sticky_posts'), 'cat' =&gt; "-$cat,-$catHidden",'showposts' =&gt; -1));
  $myrecentpostscount = count($myrecentposts2);
  </code></pre>
  
  <p>Note: get_posts() is a core WP function.</p>