title: Wordpress: Find posts in category 1 and not in category 2
body: <p>I have two categories, visible and hideMe...</p>
  
  <p>I want to list all posts in the visible category, which is easy enough. However, due to user error (or oversight) there may be some posts which are in both categories.</p>
  
  <p>How can I pull the posts that are in the visible category but not also in the hideMe category?</p>
  
  <p>Here's my current solution. I'm just not certain that the get_posts method is the least expensive option I could use...</p>
  
  <pre><code>$cat=get_cat_ID('visible');
  $cat2=get_cat_ID('hideMe');
  $myposts = get_posts(array('cat' =&gt; "$cat,-$cat2",'showposts' =&gt; 5));
  if($myposts )
  {//do something}
  </code></pre>