We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is your feature request related to a problem? Please describe. User may want to only show posts on search results.
Describe the solution you'd like Add an option either to allow user to decide if they want to show post pages on search results.
//Exclude pages from WordPress Search if (!is_admin()) { function wpb_search_filter($query) { if ($query->is_search) { $query->set('post_type', 'post'); } return $query; } add_filter('pre_get_posts','wpb_search_filter'); }
Describe alternatives you've considered
Additional context Also, an user is able to search an empty string:
Thank you!
The text was updated successfully, but these errors were encountered:
Okay.
Sorry, something went wrong.
No branches or pull requests
Is your feature request related to a problem? Please describe.
User may want to only show posts on search results.
Describe the solution you'd like
Add an option either to allow user to decide if they want to show post pages on search results.
Describe alternatives you've considered
Additional context
Also, an user is able to search an empty string:
Thank you!
The text was updated successfully, but these errors were encountered: