[ad_1]
Sorry this was my fault i had code in my functions.php causing this
function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'page');
}
return $query;
}
add_filter('pre_get_posts','SearchFilter');I fixed the issue using a better code below
function exclude_all_pages_search($query) {
if ( $query->is_main_query() && $query->is_search() && ! is_admin() ) {
$query->set('post_type', array( 'post', 'advert' ) );
}
}
add_action('pre_get_posts','exclude_all_pages_search');
Hi,
ok thanks for the feedback, i am marking this thread as resolved then.
