Use facetwp_template_html to prevent loading the template when no facets are selected

mgibbs189

{{gist file=”test.php” lang=”php”}}
<?php

function fwp_override_template( $return, $class ) {
foreach ( $class->ajax_params[‘facets’] as $facet ) {
if ( ! empty( $facet[‘selected_values’] ) ) {
return false; // don’t override
}
}
return ”; // override
}
add_filter( ‘facetwp_template_html’, ‘fwp_override_template’, 10, 2 );

{{/gist}}