Skip to content

Instantly share code, notes, and snippets.

@machouinard
Forked from mgibbs189/test.js
Created August 11, 2016 23:56
Show Gist options
  • Save machouinard/f939e441fd8903fd70ba34c757ef213b to your computer and use it in GitHub Desktop.
Save machouinard/f939e441fd8903fd70ba34c757ef213b to your computer and use it in GitHub Desktop.
FacetWP - intercept Genesis pagination
(function($) {
$(document).on('click', '.pagination a', 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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment