-2
在Wordpress阅读选项中,我将其设置为使索引最多只显示2个帖子。但是,下一页和上一页按钮丢失。我进入了我的模板,尝试了默认的方法,但都没有工作。WordPress内置分页不起作用
我尝试添加
<?php posts_nav_link(); ?>
没有工作。我然后尝试
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
</div>
哪些也没有工作。完全没有在最终页面的源代码中显示出来。这些是默认的WordPress功能,对吗?这里出了什么问题?
如果它有什么用途,这里的index.php文件
<?php get_header(); ?>
<section class="content">
<ul class="items wrap">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<h4><?php the_time('F jS, Y') ?></h4>
<p><?php the_content(__('(more...)')); ?></p>
<hr>
<?php endwhile; else: ?>
<p><?php _e('Sorry, we couldn’t find the post you are looking for.'); ?></p>
<?php endif; ?>
<!-- I added the pagination code here. -->
</ul>
</section>
<div id="delimiter"></div>
<?php get_footer(); ?>
谢谢!