Created
December 18, 2020 16:57
-
-
Save djrmom/30b034f17d1ef48671ebae9e60cded24 to your computer and use it in GitHub Desktop.
facetwp ignore query by posts_per_page
This file contains 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 | |
// Add to your (child) theme's functions.php | |
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
if ( 2 > $query->get( 'posts_per_page', 0 ) ) { | |
$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