Posted By

richerimage on 12/09/10


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

qubestream
ZedVex


Exclude Posts or Pages from Wordpress Search Results


 / Published in: PHP
 

  1. function SearchFilter($query) {
  2. if ($query->is_search) {
  3. $query->set('cat','0,1');
  4. }
  5. return $query;
  6. }
  7.  
  8. add_filter('pre_get_posts','SearchFilter');

Report this snippet  

You need to login to post a comment.