Skip to content

Instantly share code, notes, and snippets.

@pije76
Forked from mgibbs189/test.js
Created July 15, 2019 04:47
Show Gist options
  • Save pije76/0006b2543cc8ec52b294f60b5de89318 to your computer and use it in GitHub Desktop.
Save pije76/0006b2543cc8ec52b294f60b5de89318 to your computer and use it in GitHub Desktop.
Code used for facetWP reload page loop
<script>
(function($) {
$(document).on('facetwp-refresh', function() {
if (FWP.loaded) { // after the initial pageload
FWP.parse_facets(); // load the values
FWP.set_hash(); // set the new URL
location.reload();
return false;
}
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment