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
.bike-features { | |
margin-bottom: 15px; | |
} | |
#bike-features-container { | |
min-height: 400px; | |
} | |
#bike-features-inner, #bike-options-inner { | |
visibility: hidden; |
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
jQuery(document).ready(function($){ | |
$(document).on( 'click touchstart', '#pagination a', function( event ) { | |
// Fade out the old content for a smooth transition | |
$('#bike-features-inner').fadeOut(); | |
// The pagination button you clicked will pass the page number back to the callback function | |
var page = $(this).attr('href'); |
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
<?php | |
function ajax_pagination_enqueue() { | |
// Register and enqueue our javascript file | |
wp_register_script( 'pagination', | |
get_template_directory_uri() . '/library/js/pagination.js', // or wherever you put the file in your theme directory | |
array('jquery')); | |
wp_enqueue_script('pagination'); |