| 1 | I've added a patch with your approach @swissspidy but I excluded the 1 === $pagenum as that variable isn't available in this function. There's also no $paged in there to know if we're on the first page. However, the check against 'page' === $post_type and the max($min_num_pages, $query->max_num_pages) should cover us. I verified creating 2002 blog posts gave us 2 pages of posts in the sitemap and generating 4004 pages gave us 3 pages of pages in the sitemap. With 0 blog posts and 0 published pages we also got the proper experience of no posts showing up, and 1 page of the pages with the index URL set. |