Skip to content

Instantly share code, notes, and snippets.

@mikeoberdick
Created June 5, 2019 00:55
Show Gist options
  • Save mikeoberdick/15bf1b90812d71d85532cd064f279013 to your computer and use it in GitHub Desktop.
Save mikeoberdick/15bf1b90812d71d85532cd064f279013 to your computer and use it in GitHub Desktop.
Creates a drop down that can be used to filter posts per page
$('#tax-filter').change(function() {
var filter = $('#tax-filter');
$.ajax({
url:filter.attr('action'),
data:filter.serialize(),
type:filter.attr('method'),
beforeSend:function(xhr){
$('#spinner').toggle();
},
success:function(data){
$('#spinner').toggle();
$('#sortedPosts').html(data);
}
});
//debug -> console.log(filter.attr('method'));
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment