Created
July 31, 2018 17:21
-
-
Save mgibbs189/5b32c512d4f1b43344b483d274ff4485 to your computer and use it in GitHub Desktop.
Redirect when a facet is interacted with
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 && '' == FWP_HTTP.uri) { // if not the initial pageload, and we're on the homepage | |
window.location.href = '/listings/?' + FWP.build_query_string(); // redirect | |
} | |
}); | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment