Last active
October 16, 2020 19:05
-
-
Save mgibbs189/02d06d23f4603b9aa3447907ddce88f0 to your computer and use it in GitHub Desktop.
Show the reset button only when facets are active
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
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
var in_use = ('' != FWP.build_query_string()); | |
$('.your-reset-btn').toggleClass('hidden', ! in_use); | |
}); | |
})(jQuery); | |
</script> | |
<style> | |
/* add to your stylesheet */ | |
.hidden { display: none; } | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment