FacetWP – Force a Divi refresh on Blog facet selection

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

add_action( ‘wp_head’, function() {
?>
<script>
(function($) {
$(document).on(‘facetwp-refresh’, function() {
if (FWP.loaded) {
FWP.set_hash();
window.location.reload();
return false;
}
});
})(jQuery);
</script>
<?php
}, 100 );
{{/gist}}