Paging nach einer Suche mit Ajax

Ich habe mit Ajax gesucht und wollte nach Ajax suchen, wie fügen Sie eine Ladung mehr Paging hinzu? Meine aktuelle Anfrage:

function advancedSearch() { $sanpham = $_POST['sanpham']; $hsx = $_POST['hsx']; $price = $_POST['price_range']; if($_POST['sortproduct']){ $sort = $_POST['sortproduct']; if($_POST['sortproduct'] == 'viewmore'){ $meta_key = 'post_views_count'; $sortby = 'DESC'; $orderby = 'meta_value_num'; }else if($_POST['sortproduct'] == 'newest'){ $orderby = 'date'; $sortby = 'DESC'; $meta_key = ''; }else if($_POST['sortproduct'] == 'sales'){ $orderby = 'meta_value_num'; $sortby = 'DESC'; $meta_key = 'kproduct_oldprice'; }else{ $sortby = $sort; $meta_key = 'kproduct_price'; $orderby = 'meta_value_num'; } } $args = array( 'post_type' => 'post', 'posts_per_page' =>-1, 'meta_key' => $meta_key, 'orderby' => $orderby, 'order' => $sortby, 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'category', 'field' => 'slug', 'terms' => $sanpham, 'compare' => 'IN' ), array( 'relation' => 'OR', array( 'taxonomy' => 'gia', 'field' => 'slug', 'terms' => $price, 'compare' => 'EXISTS' ), array( 'taxonomy' => 'hang-san-xuat', 'field' => 'slug', 'terms' => $hsx, 'compare' => 'EXISTS' ), ), ), ); $product_results = get_posts($args); $list = array(); foreach($product_results as $product){ setup_postdata( $product ); $list[] = array( 'object' => $product, 'id' => $product->ID, 'name' => $product->post_title, 'content' => $product->post_content, 'image' => get_the_post_thumbnail($product->ID, 'entry'), 'link' => get_permalink($product->ID), 'kproduct_price' => get_field('kproduct_price',$product), 'kproduct_oldprice' => get_field('kproduct_oldprice',$product), 'km' => get_field('km',$product), 'hover' => get_field('hover',$product), 'categories' => get_the_category($product->ID), 'view' => tdc_PostViews($product->ID), ); } header("Content-type: application/json"); echo json_encode($list); die; 

}

 add_action('wp_ajax_nopriv_advancedSearch', 'advancedSearch'); add_action('wp_ajax_advancedSearch', 'advancedSearch'); 

Mein JS

 jQuery(function($) { function checkboxValueshsx() { var allVals = []; $('input[type=checkbox]#hsx:checked').each(function() { allVals.push($(this).val()); }); return allVals; } function checkboxValueshangmaycf() { var allVals = []; $('input[type=checkbox]#hangmaycf:checked').each(function() { allVals.push($(this).val()); }); return allVals; } $('select.status').on('change', function(){ var sanpham = $('#sanpham').val(); var sortproduct = $('#sortproduct').val(); var price_range = $('#price_range').val(); var postData = { action: 'advancedSearch', price_range: price_range, hsx: checkboxValueshsx(), hangmaycf: checkboxValueshangmaycf(), sanpham: sanpham, sortproduct: sortproduct, } jQuery.ajax({ url: admin_url.ajax_url, type: 'post', data: postData, beforeSend: function() { $('#loader').show(); }, complete: function(){ $('#loader').hide(); }, success: function() { $('#result').html(''); $('#title-search').html(''); $('#results_found').html(''); } }).done(function(response){ console.log(response) $.each(response, function(index, object){ //my result $('#result').append(result); }); }); }); 

Solutions Collecting From Web of "Paging nach einer Suche mit Ajax"