Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created January 22, 2021 23:02
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 djrmom/b3cd7d25ccadec9f40a0347345c2bbc4 to your computer and use it in GitHub Desktop.
Save djrmom/b3cd7d25ccadec9f40a0347345c2bbc4 to your computer and use it in GitHub Desktop.
facetwp show hide template based on facets selected
add_action( 'wp_head', function() {
?>
<script>
(function($) {
$(document).on('facetwp-loaded', function() {
if ('' != FWP.build_query_string()) {
$('.facetwp-template').show();
} else {
$('.facetwp-template').hide();
}
});
})(jQuery);
</script>
<?php
}, 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment