title: WordPress get count of posts without using get_posts()?
body: <p>Need a function call that is designed solely to get the count of posts matching a criteria. I believe the get_posts() function is too expensive for this operation. I'm merely trying to decide whether or not to show a "View More Posts" link when there are a predefined number of posts to display...</p>
  
  <p>For example, the default number of post links to display is 3. I only want to show a "View More Posts" link if the total number of posts exceeds 3.</p>
  
  <p>Here's my code...</p>
  
  <pre><code>$cat1=get_cat_ID('test');
  $cat2=get_cat_ID('test2');
  $myposts = get_posts(array('cat' =&gt; "$cat1,-$cat2",'showposts' =&gt; 3));
  $myposts2 = get_posts(array('cat' =&gt; "$cat1,-$cat2"));
      $mypostcount = count($myposts2);
  foreach($myposts as $idx=&gt;$post)
  ?&gt;
  &lt;li&gt;&lt;a&gt;Post Info Goes here&lt;/a&gt;&lt;/li&gt;
  &lt;?php 
  if ($mypostscount &gt; 3){ ?&gt;Show View All Link&lt;?php ?&gt;
  </code></pre>