Forked from snormand27/gist:da23358fe65c6486634396faab0ee14d
Last active
April 16, 2021 06:19
-
-
Save mgibbs189/4970bcf7360eb9f877ebb36f2ccacb8f to your computer and use it in GitHub Desktop.
Code used for facetWP reload page loop
This file contains hidden or 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-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