Inspiration For Creative Minds
Home » Labs » How to exclude category from WordPress search results  

Filed under Labs

Sometimes you do not like to display post in specified category on WordPress search results, below is a code for excluding a category from WordPress search. this will work fine within the loop.

 
<?php
          query_posts("s=$s&cat=-90,-100&posts_per_page=-1");
?>
It's only fair to share...Share on Google+Tweet about this on TwitterShare on Facebook
Labs

Posts you may like: