Using a custom WP_Query

If you’re trying to show facets on a WP page template (with a custom WP_Query), FacetWP probably won’t be able to auto-detect the query. No worries, we can nudge FacetWP into using it by adding the facetwp query argument:

<?php
$args = array(
    'post_type' => 'event',
    'posts_per_page' => 10,
    'facetwp' => true, // we added this
);
$query = new WP_Query( $args );

This tells FacetWP that it’s the correct query to use for filtering.