Last active
September 10, 2018 22:07
-
-
Save stegel/3f43447304f60f966bc108e99a975725 to your computer and use it in GitHub Desktop.
Custom Hook for refresh on sort
This file contains 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
add_action('wp_head', 'fwp_refresh_on_sort'); | |
function fwp_refresh_on_sort() { | |
?> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
(function($) { | |
$(document).ready(function() { | |
$('.facetwp-sort').on('change','select', function() { | |
console.log("hey"); | |
FWP.refresh(); | |
}); | |
}); | |
})(jQuery); | |
//]]> | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment