我已经为帖子创建了一个自定义循环,它与引导程序一起工作,在其中,我添加了分页,但它似乎不起作用。它只显示一个空按钮。。。
<?php $args = array(
\'post_type\' => \'post\',
\'posts_per_page\' => 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
$i = 0;
while ($my_query->have_posts()) : $my_query->the_post();
if($i % 2 == 0) { ?>
<div class="row"><?php } ?>
<div class="col-md-6">
<div class="overview">
<!-- Post details here -->
</div>
</div>
<?php $i++; if($i != 0 && $i % 2 == 0) { ?>
</div><!--/.row-->
<div class="clearfix"></div>
<?php }
endwhile; ?>
<nav class="pagination">
<button class="btn-whole"><?php previous_posts_link(\'Previous\') ?></button>
<button class="btn-whole"><?php next_posts_link(\'Next\') ?></button>
</nav>
<?php } wp_reset_query(); ?>
你知道为什么会这样吗?