Created
April 20, 2016 16:41
-
-
Save adaptifyDesigns/f68eee177a74e660b084540b9da3675e to your computer and use it in GitHub Desktop.
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
/** | |
* Ensure that FacetWP detects custom post-type query loops: | |
* NOTE: the query vars must have a custom 'facetwp' parameter, like this: | |
$args = array( | |
'post_type' => 'event', | |
'posts_per_page' => 10, | |
'facetwp' => true, // we added this | |
); | |
$query = new WP_Query( $args ); | |
*/ | |
function wuwo_facetwp_is_main_query( $is_main_query, $query ) | |
{ | |
if ( isset( $query->query_vars['facetwp'] ) ) { | |
$is_main_query = true; | |
} | |
return $is_main_query; | |
} | |
if( function_exists('facetwp_display') ) | |
{ | |
add_filter( 'facetwp_is_main_query', 'wuwo_facetwp_is_main_query', 10, 2 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment