Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active October 7, 2020 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/76c1b3cc129315490fd46016dd85370e to your computer and use it in GitHub Desktop.
Save mgibbs189/76c1b3cc129315490fd46016dd85370e to your computer and use it in GitHub Desktop.
FacetWP - ignore archive query when using a shortcode template
<?php
// Add to your (child) theme's functions.php
add_filter( 'pre_get_posts', function( $query ) {
if ( $query->is_post_type_archive( 'reviews' ) || 'ct_template' == $query->get( 'post_type' ) ) {
$query->set( 'facetwp', false );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment