wp-pagenavi support

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
<?php

// Add to functions.php
function fwp_pagenavi_support() {
?>
<script>
(function($) {
$(document).on(‘facetwp-refresh’, function() {
if (! FWP.loaded) {
$(document).on(‘click’, ‘.wp-pagenavi a.page’, function(e) {
e.preventDefault();
var matches = $(this).attr(‘href’).match(//page/(d+)/);
if (null != matches) {
FWP.paged = parseInt(matches[1]);
}
FWP.soft_refresh = true;
FWP.refresh();
});
}
});
})(jQuery);
</script>
<?php
}
add_action( ‘wp_head’, ‘fwp_pagenavi_support’, 50 );

{{/gist}}