Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function remove_pages_from_search($query) {
- if ($query->is_search) {
- $query->set('post_type', 'post');
- }
- return $query;
- }
- add_filter('pre_get_posts','remove_pages_from_search');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement