我在单个帖子的上一个链接分页中遇到问题。我总共有12个帖子,在接下来和之前它每次只显示两个帖子。这是我的代码。
<?php
global $wpdb;
$args = array(
'category ' => $catid,
'order' => 'DESC',
'posts_per_page'=>1,
'paged' => $paged
);
query_posts($args);
$total_posts = (int) $wp_query->found_posts;
$prev_post = get_previous_post();
$prevID = $prev_post->ID ;
$next_post = get_next_post();
$nextID = $next_post->ID ;
$all_posts = $all_post_query->post_count;
?>
<div class="paginate">
<?php $prev_post = get_previous_post();
if (!empty( $prev_post ))
{
echo '<span class="glyphicon-chevron-left">'; previous_post('%',' Previous', 'no'); echo '</span>'; ?>
<?php } else { ?>
<?php echo 'Previous'; } ;?>
<?php if(!empty($nextID)) { ?>
<?php echo '<span class="glyphicon-chevron-right">'; next_post('%', 'Next', 'no'); echo '</span>'; ?>
<?php } else { ?>
<a class="next"><?php echo 'Next'; } ; ?></a>
</div>
</div>