Total number of pages is $query->found_posts
divided by $per_page_default
. If the current page number is less than that amount, there are more pages.
post_count
isn’t the total amount of posts, as the answer on the question you linked states, it’s the total number of posts on that single page only. That’s not going to tell you anything except maybe that you’re on the last page if the number happens to be less than total per page, but will fail if the total is divisible without remainder.
Related Posts:
- Problem: ( kriesi ) pagination doesn’t work in homepage [duplicate]
- Custom Page Template for “Older Posts” Pages
- Home page not obeying post per page setting on the first page only
- Next & Previous (Pagination in this case) Not Appearing
- Why does pagination go to a blank page when navigating through home.php?
- Pagination stopped working after assigning custom page template to new page (different slug)
- Adding pagination on template page wordpress
- Pagination 404s on custom query
- How do I make my pagination work?
- Show content based on page number
- Remember form field values with page navigation
- Customizing Latest Post Pagination
- Blog pagination WITHOUT using max_num_pages
- Page navi for template page
- How to add numbers pagination to this blog page?
- Pagination is not working in custom page template
- get_posts custom paging
- Pagination not working on blog grid
- pagenavi shows a lot of pages calculated from all posts in the site with query_posts
- paged query leads to 404? [duplicate]
- Separate page for pagination possible?
- Changing pagination list class
- How to show a single post on the front page but have normal paging?
- Pagination resolving to first page only
- Pagination of RSS2 feed
- Modifying WP_LIST_AUTHOR Functions to output all users in a grid (and Paginate)
- How to ignore or disable nextpage tag?
- Category pagination shows same posts
- category/category_name pagination 404 error
- get_query_var(‘paged’) giving same result
- Show content only on front page?
- Getting 404 on taxonomy page
- Why am I getting a 404 on anything past page 1 of my query?
- Getting pagination for second loop to work on single.php
- 5 posts per page from single category, paginated
- WordPress custom URLs for pagination pages
- How to add pagination to a single post
- Get Pagination (WP-PageNavi) not to work
- WordPress rewrite rules for pagination on search page
- Styling the_posts_pagination With Font Awesome
- Pagination on 2nd loop
- Problem with parameters in url and pagination
- How can I show a multipage post as a single, wrapped post?
- Pagination with $_POST and $_SESSION
- wordpress is converting ?page=2 into /2
- Template hierarchy about pagination after front-page.php
- Why do next pages load the same content rather then older articles?
- Nested Pagination
- Add pagination to my custom loop [duplicate]
- Pagination with WordPress default gallery?
- Yoast’s rel=“next” & rel=“prev” tag don’t work on static homepage’s paginated pages
- How do i improve my custom pagination?
- Post Pagination Customization (wp_link_pages) Editing Navigation
- Default pagination is broken when use ‘static page’ as ‘front page’
- Using paginate_links() to generate “01, 02, 03, 04” paginations
- Paginate results from data fetched through array
- make a pagination that show posts by date
- Pagination on custom post type not working if permalinks set to rewrite url
- Theme Option not Working Inside a Function
- search with pagination not working as expected
- Cannot go back to the first paginated page using pagination links
- How do you choose to display specific posts/pages by parent url
- Custom category.php paging shows the same posts
- Pagination Links showing incorrect previous page number
- How to limit page pagination… again
- Paginate Links – Mid Size Less Than 2
- Automatically adding a link to the next page link before ” tag in posts?
- Hide content after going to page 2 of archive, show content when back at first page
- Add pagination to this following template
- split wordpress loop into columns of categories and associated posts
- How Change URL in Pagination pagebreak no plugins wordpress?
- How is the Page Splitting implemented in the theme?
- Why the page number does not appear in splitting post?
- Use of rewind_posts() cause pagination to break
- Pagination not working in custom post type but perfectly in posts
- WordPress static home page pagination not working
- Paginate Images To Similate Map Drill-Down
- Custom pagination with URL parameters
- how to add pagination to a popular post custom page?
- Add pagination – syntax error when copy/pasting
- Remove “Page” from Category archive
- Problem with Paging 404
- Pagination not working past page 3 on archive page of category
- Using the_posts_pagination with offset adds extra empty page
- Excluding posts without affecting the number of posts per page
- get_next_posts_page_link adds Inexistent directories
- Search, pagination, the last pages leads to 404 page
- Pagination – linking back to base page – Page 1
- Custom Pagination shows same posts on each page
- Numbered pagination showing all numbers instead of paginated blocks
- Show next and previous page number
- Search pagination link redirecting to a link that doesn’t work with pagination
- Adding pagination to query for custom page
- Main page paginate_links issue
- WordPress creating 404s under blog tags
- Removing template part when not on homepage if / else
- Paginate template name
- How to reduce the number of pages in pagination
- foreach pagination
- Pagination only working on index page not on a template page