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