Hello,
Congradulations for your excellent work.
I have a problem with filters if i change that search query to include specific products.
I am using a function like
function neuro_search_filter( $query ) {
if ( $query->is_search && $query->is_main_query() ) {
$query->set( ‘post__in’, array( 1477, 1487 ) );
}
}
add_action( ‘pre_get_posts’, ‘neuro_search_filter’ );
Where i say to say to search query to include only posts 1477, 1487 in search results regardless what is searched. If i do so, search results are OK, include only those 2 products, but sidebar filters include all posible values and not all available to the 2 products as it would be if i did a normal search.
Is there any other place i can put my code in order to display disired results but have the filters working also?
Thank you.