Forums › Forums › Search & Filter Pro › Results not displaying until a selection is made
Tagged: empty results
- This topic has 31 replies, 3 voices, and was last updated 6 years, 4 months ago by
Trevor.
-
Anonymous(Private) November 7, 2019 at 9:38 am #225985
Hello, I found a post with this same issue in the title (https://support.searchandfilter.com/forums/topic/results-not-displaying-on-home-page-until-a-selection-is-made/), but all the replies are marked as private.
So, why I am not seeing any results untilI select or deselect something? Regardless of Ajax being activated or not, and regardless being in the home page or archive page.Thank you.
Anonymous(Private) November 8, 2019 at 11:21 am #226099Hello, I think that the problem is related to my filter that adds custom post types to the main query.
I just created a regular post and it shows.This is the filter I am using:
add_filter( ‘pre_get_posts’, ‘wpshout_add_custom_post_types_to_query’ );
function pmi_add_custom_post_types_to_query( $query ) {
if(
(is_home()||is_category()) &&
$query->is_main_query() &&
empty( $query->query_vars[‘suppress_filters’] )
) {
$query->set( ‘post_type’, array(
‘post’,
‘event’,
‘story’,
‘patent’
) );
}
} -
AuthorPosts