У меня действительно большая проблема с разбиением на страницы. Когда я нажимаю следующий пост - wordpress покажу мне то же самое 9 сообщение. Что плохого с этим? Это meybe в массиве $ row? Мне нужно просмотр custome post и разбиение на страницы.Pagination in wordpress показать то же сообщение
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'posts_per_page' => 9,
'paged' => $paged
);
$query = new WP_Query (array($args) );
$row = array(6, 3, 3, 4, 4, 4, 3, 3, 6);
$i = 0;
if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id ($the_query->ID), 'thumbnail');
?>
<div class="col-md-<?php echo $row[$i] ?> col-xs-6">
<div class="blog-item scrollpoint sp-effect2">
<div class="cover" style="background-image: url('<?php echo $thumbnail[0] ?>')">
<div class="mask">
<div class="post">
<span class="kategoria"></span>
<div class="tresc">
<h1> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
<div class="wypis"><?php echo get_the_excerpt(); ?></div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
$i++;
endwhile; ?>
<!-- pagination -->
<?php previous_posts_link('« Newer posts') ?>
<?php next_posts_link('Older posts »') ?>
<?php wp_reset_postdata();?>
<?php else : ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
Спасибо, что это работает. –