$current_page = !empty( $_GET['stranitsa'] ) ? $_GET['stranitsa'] : 1;
$args = array(
'post_type' => 'nashi-raboty',
'posts_per_page' => 2,
'orderby' => 'date',
'order' => 'DESC',
'paged' => $current_page,
);
echo paginate_links( array(
'base' => '%_%',
'format' => '?stranitsa=%#%',
'total' => $query->max_num_pages,
'current' => $current_page,
'prev_text' => __('<svg class="icon icon-color icon-color--brown">
<use xlink:href="#icon_arrow-right"></use>
</svg>'),
'next_text' => __('<svg class="icon icon-color icon-color--brown">
<use xlink:href="#icon_arrow-right"></use>
</svg>'),
) );
jQuery(function ($) {
jQuery(document).on("click", ".page-numbers", function (e) {
e.preventDefault();
var page = $(this).attr("href").replace("?stranitsa=", "");
jQuery.post(
ajaxSite.ajaxurl,
{
action: "get_cat",
paged: page,
},
function (response) {
$("#ajax-content").html(response).animate(
{
opacity: 1,
},
300
);
}
);
});
});