facetwp check main query with uri

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php

add_filter( ‘facetwp_is_main_query’, function( $is_main_query, $query ) {
if ( ‘residents’ == FWP()->helper->get_uri() && ‘resident’ != $query->get( ‘post_type’ ) ) {
return false;
}
return $is_main_query;
}, 10, 2 );
{{/gist}}