FacetWP – determine whether the selections box is empty

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
<script>
(function($) {
$(document).on(‘facetwp-loaded’, function() {
if (” == FWP.build_query_string()) {
$(‘.no-results-message’).show(); // there are no active facets, show the message
}
else {
$(‘.no-results-message’).hide(); // hide the message
}
});
})(jQuery);
</script>
{{/gist}}