WordPress博客分页不起作用 [英] WordPress Blog Pagination Not Working
问题描述
我仍然在这个问题上停留.
I'm still stuck on this issue..
我的WordPress博客上的分页不起作用- http://www.example.com/news
The pagination on my WordPress blog is not working - http://www.example.com/news
当您单击其他页码时,它会正确更新URL(和页面标题),但不会显示不同的帖子.
When you click a different page number it updates the URL (and page title) correctly but it does not show different posts.
我尝试过:
- 禁用所有插件
- 更改永久链接结构
- 更改设置">阅读"中显示的博客帖子数量
- 将 http://www.example.com/recall-news 更改为其他路径,以避免与发表名为新闻"的类别
- Disabling all plug-ins
- Changing the permalink structure
- Changing the number of blog posts displayed in Settings>Reading
- Changing http://www.example.com/recall-news to a different path to avoid conflicting with a post category named "news"
对我没有任何帮助.
我已经看到了许多针对自定义查询的解决方案,但是我使用的是您在设置">阅读">帖子"页面中设置的帖子页面,因此我没有编写任何代码来显示此页面上的帖子.
I've seen many solutions for a custom query, but I'm using the posts page that you set in Settings>Reading>Posts Page so I did not write any code to display the posts on this page.
- 在这种情况下,我可以修改哪些WordPress文件来修复博客分页?我猜我可以在functions.php中添加一些内容,但是我还没有找到解决方案.
更新:我还没有找到解决方案.我知道我可以通过编写自己的查询来做到这一点,但我想坚持使用默认的WP博客.
UPDATE: I have not found the solution yet. I know I can do it by writing my own query but I want to stick with the default WP blog.
推荐答案
在category.php文件(也称为archive.php)中检查WP循环.它必须包含以下内容:
Check your WP loop in the category.php file (aka archive.php). It must contain the following:
if (have_posts()) : while (have_posts()) : the_post();
并以:
endwhile; endif;
这篇关于WordPress博客分页不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!