Show single post then all posts (with pagination)

Pagination does not work well will with secondary queries.

First, the ordinary pagination functions depend upon the main query in the global variable $wp_query. They won’t work with secondary queries. There are already a number of questions here about that if you search the site.

Second, trying to paginate secondary queries tends to result in 404 status pages. That is because the query that runs before the template loads– the “main” query– is the one that determines what page to load and it does not know about the query written into your template.

I would suggest you use paginate_links for your secondary query pagination. There are numerous examples of use here on this site, for example: https://wordpress.stackexchange.com/a/73928/21376

Leave a Comment