Custom Post Type Pagination – not displaying posts

I seem to have run into a massively common problem, and found about 956 solutions to the issue that didn’t seem to knock this one loose.

I have a client with a WP site built on Divi theme. And i implemented a custom post type for them to handle a daily post for their site.

Got the CPT done correctly and working fine.
Got the custom fields going using the ACF plugin, all good there.
Got the custom archive page displaying the posts using wp_query, check.

(worth noting the query is ordered by a custom field that is a future date that is defined by them that is relevant to each post)

They only want 1 post per page, so clicking back and forth through the pagination links would display one at a time. So I used the code below which seems to be a pretty straight forward way of implementing pagination for this purpose, but what happens is , when the “Older Entries” link is clicked it loads a 404 no results found page. It’s generating the correct URL structure is seems “ie,”, but the next post is not displayed on the page.

Any ideas or suggestions would be appreciated.

Read more here:: Custom Post Type Pagination – not displaying posts

Leave a Reply

Your email address will not be published. Required fields are marked *