Здравствуйте, как реализовать пагинацию?
<div class="otel-open-1">
<?php
if($newCat == ""){
$cathotel = "14";
$arrcathotels = explode(",", $cathotel);
} else{
$cathotel = $newCat;
$arrcathotels = explode(",", $cathotel);
}
?>
<?php
$args = array(
'orderby' => date,
'numberposts' => 999,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $arrcathotels,
'operator' => 'IN'
),
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => '14'
)
)
);
?>
<?php
$posts = get_posts($args);
?>
<?php foreach ($posts as $post) : setup_postdata ($post); ?>
<div class="image_sp col-sm-3 col-xs-12 imsp_el1">
<a href="<?php echo get_permalink(); ?> ">
<?php the_post_thumbnail() ?></a>
<div class="hdsp_text">
<h3><?php the_title(); ?></h3>
</div>
</div>
<?php
endforeach;
wp_reset_postdata();
?>
</div>