facetwp only wc_query for product post type

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php
/* only filter woo product query if cpt is product */
add_filter( ‘facetwp_is_main_query’, function( $is_main_query, $query ) {
if ( ‘product’ == $query->get( ‘post_type’ ) && ‘product_query’ != $query->get( ‘wc_query’ ) ) {
$is_main_query = false;
}
return $is_main_query;
}, 10, 2 );
{{/gist}}