$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
- Parameter for pagination posts_pagination
- Only show featured image on first page of paginated posts
- Getting blog pagination to work on page set as front page
- How do you search for a post or page with a certain url on the WordPress admin panel?
- Very complex post query
- How to add some html formated text to every new post in WordPress
- Delete post revisions only for a single post
- Intercept page request and add value to it
- Change the number of excerpts displayed in search results layout
- How to give classname to post if post has no content?
- Display post by click on the link
- WordPress 302 Redirect to Random Product/Post/Page
- Output Post with ACF Fields into other Post
- How to create a page that shows the last 10 posts?
- $_GET parametters not working in an specific template
- Queries take 120+ seconds on my large WordPress site
- Exclude some posts from displaying in wp_query based on some condition
- New Posts and Pages Won’t Save
- My Custom Post Type Still Using index.php
- get_children returns older images
- Posts and Pages: 404 Page not found
- WordPress pagination and Post Navigation not working on home page
- Related Posts function not working
- How to retrieve certain number of images from a wordpress post?
- Custom Post Limit for homepage only without plugin?
- the_content() Not Grabbing All Content
- Display Featured Posts Grid on Static Page (Gazette)
- Detecting current page from class method
- Having pages after specifying post_type post
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- List all posts, pages and custom post types in admin
- How to convert query sql to shortcode in wordpress?
- WordPress loop not working on static front page
- Make ‘blog’ page show content as well as posts underneath it
- I don’t want the complete article to show on homepage
- Post/page title to permalink transformation – what is behind the scenes?
- Change Author Name to Sitename on Frontend
- Would a “hub” page work better as a page or a post?
- Some doubts about how the loop work (trying debugging it)
- Display on page every post in blog WITH comments
- Are post, page and category IDs unique to each other?
- Showing recent post of category in page
- HTML Inside of Shortcode Breaks Shortcode Output
- Unable to paginate a custom page query
- Setting limit to posts or page creation
- How to display only one category in a custom post type?
- Create a frontpage.php and static page template
- Using Posts Like a Page
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- posts going to 2 pages/categories only show up in 1
- Have posts included on a page that share same category
- Preview page/post revisions without overwriting current content
- Adjust the order for returned posts
- Export all posts to import as product items
- Link from Post to Another Post Via Clicking on Words within Original Post
- get last post’s link with SQL query
- Page of posts made to look like homepage
- post/page content
- Link to older links
- How to link post titles on page A to its posts on page B?
- WordPress Architecture as a CMS – Posts & Pages
- Is it to possible to insert a page in the post depending on the category ofthe post
- Organization of time insensitive content
- Trim posts from WP-Query?
- Direct some posts to only appear on a specific page
- Adding if statement into the_content()
- How can I add a page that shows posts from a single category?
- How to show next/prev link, when it’s not active?
- Custom Select Query – Selecting the Year?
- Archieve page, Advertisement Every 3 Posts
- Pagination for posts inside a specific category
- Anyone know a php snippet for showing the first 200 characters of the most recent post?
- Prevent 404 of Author pages without posts
- Get current taxonomy and display query accordingly
- Show 10 latest posts only from users with contributors role
- Trying to exclude custom posts based on date, while sorting by custom field
- Different post views for different category views