我有一个名为“服务”的类别。单击“我们的服务”后,控制转到类别。php文件。因此,我需要显示该服务类别中的所有帖子。我可以在一个页面中显示所有这些内容。但我需要用分页的方式向他们显示每页应该有一篇文章的地方。我使用下面的部分进行分页。
<div class="content-inner">
<?php global $cat_name;
$cat_name = get_category(get_query_var(\'cat\'))->name;
echo \'<h2 class="entry-title">\'.$cat_name.\'</h2>\';
?>
<?php if ( have_posts() ) :
?>
<?php query_posts(\'category_name=\'.$cat_name.\'&posts_per_page=1&order=ASC\'); ?>
<?php while (have_posts()) : the_post();?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<br><br> <div class="popthumb"><h3>
<li type="square"> <a href="<?php the_permalink(); ?>" title="<?php //the_title(); ?>"><?php //the_post_thumbnail(); ?><?php the_title(); ?></a></li>
</h3>
</div>
<div class="popcontent">
<?php the_excerpt();?>
</div><br>
</article><br><br>
<?php endwhile; ?>
<?php endif; ?>
<div class="alignleft"><?php previous_posts_link(\'« Previous\') ?></div>
<div class="alignright"><?php next_posts_link(\'Next »\') ?></div>
我在服务类别中总共有3个职位。根据代码,每页只显示一篇文章。但当我单击“下一页未找到”时,错误正在发生。我该怎么办?