facetwp hide/show map

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php
/**
* initially hide the map facet ( .facetwp-facet-map ) and toggle visibility on click of .show_map
*
*/
add_action( ‘wp_head’, function() { ?>
<style>
.facetwp-facet-map {display: none; }
</style>
<script>
(function($) {
$(document).ready(function() {
$( “.show_map” ).click(function () {
$(“.facetwp-facet-map”).toggle( “slow” );
});
});
})(jQuery);
</script>
<?php });
{{/gist}}