WordPress Blog Pagination Not Working

2019-06-16 06:46发布

I'm still stuck on this issue..

The pagination on my WordPress blog is not working - http://www.example.com/news

When you click a different page number it updates the URL (and page title) correctly but it does not show different posts.

Ive tried:

  • 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"

Nothing has worked for me.

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.

  • What WordPress file do I modify to fix the blog pagination in this case? I'm guessing I can add something to functions.php, but I haven't found a solution yet.

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.

7条回答
走好不送
2楼-- · 2019-06-16 07:29

There is no guarantee that your issue is WordPress related. However, because you haven't given a very general question, I am going to give you a very general answer. This should aid you in figuring out what is wrong and solving it yourself.

  1. Check out underscores. Download it and review the templates (like index.php, archive.php, etc.) to see if you're missing something that underscores includes. The nice thing about underscores is that it's all the basic stuff you need to create a running theme, with no frills. So, if it's there and not in your code, it may be worth exploring. Take special care for any code blocks relating to have_posts.

  2. It may not actually be anything wrong with your theme. Try testing another theme (say, underscores, which you've conveniently downloaded) to see if it has pagination working and intact. If it does, then, you're in luck... That means you just have to dig a bit deeper to reconcile what's wrong with your code that's right with underscores.

  3. If you've discovered that it's not something wrong with your theme but in fact something wrong with your server configuration, that's also something of a relief, in a matter of speaking. It means that you should theoretically be able to test your installation somewhere else, or reinstall your server, and make it work. Before going that far, try to simply reinstall your version of WordPress. Who knows... It could work.

查看更多
登录 后发表回答