Hide template if no selections

<?php

// Add the code below

add_action( 'wp_head', function() {
?>
<script>
(function($) {
    $(document).on('facetwp-loaded', function() {
        if (FWP.loaded || '' != FWP.buildQueryString()) {
            $('.facetwp-template').show();
        }
     });
})(jQuery);
</script>
<?php
}, 100 );