Category page 2 url doesn’t exist
The answer is to use pre_get_posts. See WordPress Pagination not displaying posts after certain page As Milo says “WordPress determines if a paginated page exists based on the results of the main query”. I was using a custom query that was setting posts_per_page to 5 but in Settings this value was set to 10. Using … Read more