add_action('pre_get_posts', function( $query ) {
if ( $query->is_search() && 'book' == $__POST['post_type']) {
$query->set('post_type', 'book');
}
}, 999 );
The key is that 999, which should cause this code to run last. You can add a similar if statement for products. Just find something unique about the product search that can be checked, just like I did with $__POST['post_type']
.
I have found the solution for this. Theme add “INNER JOIN” query in search so that why this is happens with me.
Something like this:
add_filter('posts_where','atom_search_where');
add_filter('posts_join', 'atom_search_join');
add_filter('posts_groupby', 'atom_search_groupby');
This used in theme for Candidate search. Which is not module so I commented this code.
Thank you vary much for help.
]]>