I found the solution. I was looking for:
$wp_query->post_count
And some of my assumptions were not correct. This is the actual output:
Total posts from the loop 22. Posts per page 10. 1 sticky post.
- Page 1 gives 10 (9 + 1 sticky).
- Page 2 gives 10.
- Page 3 gives 2.
Related Posts:
- Five posts from a category in footer
- Paginate pages with dynamic query
- filter posts by meta key with pagination
- Show number of posts AND number on current page (cannot make it work)
- Some doubts about how the main query and the custom query works in this custom theme?
- Multiple WP_Query loops with Pagination
- WP_Query vs get_posts
- Pagination returns 404 after page 20
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- Order posts by ID in the given order
- Pagination with WP_Query is buggy – working for some pages, but not the others
- WordPress Custom Query to show posts from last x years
- Query Custom Meta Value with Increment
- Why does pagination always break when used on any form of a home page?
- Pagination with 5 posts per page
- Pagination/infinite scroll with WP_Query and multiple loops
- Pagination Not working on Home Page with 2 Query
- ‘paged’ in wp_query doesn’t work
- Display different number of posts from one category on the different pages
- Pagination not working Search posts
- Transient pagination not working properly
- Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Woocommerce custom loop to show all the products [closed]
- How to bring specific post to front of wordpress loop?
- Merged two WP_Queries, posts per page and pagination not working
- Too many posts cause slow load when paginating
- Pagination stops at page 6
- Paginated HTML Sitemap
- Multiple WP_Query loops with Pagination Not Working
- Posts loop with pagination on a single post page
- 2 loops on page – one with orderby rand second orderby date
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- Pagination is broken and I need help fixing it
- Query posts by specific word on title
- Storing query variable and then using wp_reset_query
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- Multiple loops without repeating content
- WP_Query condition affects posts_per_page count
- Blog post per page setting conflicting with custom WP_Query?
- posts_per_page not working for first page of pagination
- Some doubts about how the main query and the custom query works in this custom theme?
- Custom loops, sticky posts, and pagination nightmare
- pagination not working for category.php (custom post types in categories)
- How do I get my custom query to work with search results after the first page?
- Include current post into loop
- How to provide meta_key array to wp_query?
- get_posts output always same post
- “paged” in WP_Query returns 0 posts
- Pagination on category.php and tag.php not working
- How to create custom query by keyword in post title?
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Conditional operator OR not working with custom fields
- Pagination on template page for custom query redirecting to index.php
- Get posts that do not have the same tags as current
- Should I reset $wp_query?
- 2 queries with counters
- Second loop pagination changes URL, not content
- I am officially missing something about transient posts
- Query Not working as expected
- WP_Query orderby random do not repeat infinite scroll – one loop
- Trouble Making WP_Query paged
- Performance concerns: index.php vs taxonomy-$taxonomy.php
- Determine if ID is page or post and query the ID
- Custom template for password protected page
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Function the_posts_pagination() not compatible with WP_Query arguments
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- Duplice post with standard WP loop – fixed by using query_posts() instead
- How do I stop the same post showing multiple times in a archive?
- Pagination inside the blog page not working
- Custom query for custom post type not getting correct post ID
- Problem with my loops
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- Paging works correctly on local version, but not live?
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Problem with custom WP_Query and underlying pagination/posts_per_page
- query_posts() doesn’t seem to be called in my page
- Some doubts about how the main query and the custom query works in this custom theme?
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- Pagination returns 404 after page 20
- Ordering Posts by parent category, name ascending
- custom query – offset to pagination
- Pagination not working with WP_QUERY
- Next / previous posts link doesn’t show up with Posts 2 Posts
- No content found on page 2 of pagination with 1 post per page
- wp_query pagination links producing 404
- Converting an existing query_posts to WP_Query
- Loop being strainge
- Why won’t my paged wp_query work? [duplicate]
- send user to first page of results when reposting to page?
- Pagination in custom query not working [duplicate]
- Multiple loops on index page with sticky post and pagination
- Pagination problem with multiple loops on the same page
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- WordPress Post Looping? [duplicate]
- Pagination not working in secondary query
- Pagination in category.php not functioning