wordpress snippets last updated   : September 29, 2014
we now have 639 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
<?php
          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