$wp_query->post_count
is supposed to work exactly like that. To get the total number of posts that exist in the database, use $wp_query->found_posts
Related Posts:
- The next_posts_link() works only with original $wp_query
- Skipping first 3 posts in wp query
- Automatically create pages in a post based on number of words
- Pagination not working on Custom Page Template
- Pagination for Pages and Posts
- How can I get all posts data from within a paginated search result?
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- 301 (static page instead latest posts)
- Start post pagination at 0 instead of 1
- Total number of posts in query (category/tag/author/search results/main page…)
- Why won’t pagination work?
- Pagination for normal (standard) posts on a page with a custom loop?
- Prevent duplicate pages from being added
- Go back to the exact post page number
- Disable pagination in posts and pages
- Posts are not showing up on next page.
- Custom Select Query pagination not working properly
- Add wp-link-pages to post
- How to display a paginated list of posts from one category on a page? [duplicate]
- The next_posts_link() works only with original $wp_query
- Limit amount of pages shown in pagination within wp_query
- The page that displays Posts on homepage
- Should we trust the post globals?
- Allow variable amount of comments before pagination
- how to limit edit_form_after_title hook to page and post edit only?
- How to know if get_posts() failed?
- Create custom page in WooCommerce
- Duplicate posts
- Looping through posts per category gives same posts for each category
- Change WordPress post-state in Admin Area
- Programmatically inserting page breaks
- how to show all post in my page-grid.php template page
- eBooks download website, page or post?
- Can I hide a specific post from latest posts page?
- Hide add new page button
- Load posts into sidebar and paginate via ajax?
- How to show post(excerpt) from specific category on wp page?
- How To Keep Posts from Being Displayed Two or More Times on My Homepage? [closed]
- Check if post exists
- How to display different number of posts
- Getting content from a single *page* of a post
- Can I divide the pages into categories?
- How do I get blog posts to appear within CMS?
- Drag posts and pages so you can sort them in order
- pagination for single post by category
- Exclude the first ‘n’ number of posts of a tag from home page?
- Using wp_list_pages() after calling query_posts()
- Multiple Loops Breaking Pages
- Why are my paginated posts always returning the same results?
- Proper way of establishing custom landing pages in WordPress
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Admin – no Featured image choice in create new/page|post
- How to add some html formated text to every new post in WordPress
- Output Post with ACF Fields into other Post
- Exclude some posts from displaying in wp_query based on some condition
- Posts and Pages: 404 Page not found
- Custom Post Limit for homepage only without plugin?
- List all posts, pages and custom post types in admin
- Are post, page and category IDs unique to each other?
- Unable to paginate a custom page query
- Create a frontpage.php and static page template
- get last post’s link with SQL query
- How to show next/prev link, when it’s not active?
- Prevent 404 of Author pages without posts
- Cannot publish posts, but can create new pages
- Making a new post visible on a specific page
- Can I restore restore content from old Worpress site to a new Worpress site from an archive
- How Do I Redirect WordPress Pages but not posts?
- Custom Fields – How to get the list of a specific active widget each time it rendered
- How to show only homepage in google results instead of privacy, contact pages
- Problem paginating a subquery on a post
- Google indexing duplicate page content with Page #### in post title and /page-2 in permalink instead of the ones I set
- Show post count in custom taxonomy page
- How to show WP admin edit page within template page/post?
- Display all tags even if they are not assigned to a post
- How to display the pagination in my post list? [duplicate]
- How can I get the last post while on the first post for pagination? As if it were infinite
- How do I make it so that new posts within a certain category go into a certain page?
- Allow users to create their own page/s
- some posts being displayed as pages
- Make a paginated article (for easier reading on mobile)
- Displaying Results From Custom Taxonomy Query
- Make Show Notes for Individual Podcast Episodes Easy to Find (multiple URL’s?)
- Get part of a page url
- can’t post immediately
- Displaying only posts from a certain category on my custom page template
- Make division in post_query?
- Where are my posts linked to? I keep getting a Not Found Error, and I have no single.php page
- WordPress posts loop pagination – first page return 125 posts instead of 10 and the rest return 10
- Display one post randomly from category on home page
- How to get pagination working with “Pending” Posts
- Custom post page has attributes of latest post [closed]
- WordPress “Posts Page” isn’t showing template dropdown
- Adding Count Post in Page
- How to have 2 posting pages on a blog
- change page name on page list
- Display posts with id equal to relationship value
- Show a page counter for pagination
- Sort Posts Alphabetically Based on Specific Category (Divi)