Created
January 22, 2021 23:02
-
-
Save djrmom/b3cd7d25ccadec9f40a0347345c2bbc4 to your computer and use it in GitHub Desktop.
facetwp show hide template based on facets selected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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