Skip to content

Instantly share code, notes, and snippets.

@stegel
Last active September 10, 2018 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stegel/3f43447304f60f966bc108e99a975725 to your computer and use it in GitHub Desktop.
Save stegel/3f43447304f60f966bc108e99a975725 to your computer and use it in GitHub Desktop.
Custom Hook for refresh on sort
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