Last active
September 26, 2020 15:15
-
-
Save djrmom/d52bdc6dec2a1e33197dc8bd0fcd9d13 to your computer and use it in GitHub Desktop.
facetwp only products
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* only filter product queries */ | |
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
if ( 'product_query' != $query->get( 'wc_query' ) ) { | |
$is_main_query = false; | |
} | |
return $is_main_query; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment