1. function mySearchFilter($query) {
  2. if ($query->is_search) {
  3. $query->set('post_type', 'post');
  4. }
  5. return $query;
  6. }
  7. add_filter('pre_get_posts','mySearchFilter');
Comments powered by Disqus