wordpress snippets last updated   : August 18, 2014
we now have 638 snippets

Exclude cat from search

wordpress snippet

Adding this PHP code just above the loop in your wordpress search.php template. Make sure to place a - minus before the category ID you wish to exclude.

snippet :  PHPcopy
          query_posts($query_string . '&cat=-3');

Did you like this post? If so please share it with your friends. Thanks!

jqsnipp.com | we just launched jquery snippets website