Instead of $postsTrue->post_count;
, try $postsTrue->found_posts;
which returns the number of posts queried. $post_count
counts all the posts being displayed.
Reference: codex
Related Posts:
- Search Posts with Custom Fields as query
- Extend product search with meta in WooCommerce
- Search posts missing a particular custom field
- Categories In English version showing not canonical URL, instead shows query search result
- Custom search (wp query by custom fields)
- Custom Search Query – include only custom fields and title
- How to include custom fields in wordpress search
- Extend search query to search meta keys values based on search string
- Can I force WP_Query to return no results?
- Search multiple custom fields by using meta_query
- Sorting posts by custom date fields (non standard date format)
- Group posts by custom field
- getting posts and number by specific meta value in multiple meta
- Custom search form with empty parameters
- How to query using a combination of custom_field values?
- Query two post types and order by two different date fields
- Multiple search queries on one page
- How can i make WP_Query return post image and categories?
- How add a custom posttype name using ACF field to a query post array
- Ordering Posts Type A by Custom Fields of related Post Type B
- Including only current user’s posts in search
- Custom category search box for WordPress
- Refine search results using WP_Query
- Creating a custom search for a specific post type
- Assigning a meta_query value based on regexp to wp_query fails
- Add quicklink to in the Admin posts page where I can query by a meta_key
- How to make Meta Query case sensitive?
- Search for multiple tags?
- wp_query ‘s’, search filter with pagination is not working
- Meta_query with multiple keys and multiple values
- WordPress Comments sort by custom meta key
- Understanding the orderby in WP_Query?
- How to list custom fields as headers and list all pages sharing that custom field under it?
- Display filtered results into custom page
- Order by empty custom field
- Query posts without meta preload
- Cutom wp_query for geolocation search, pagination not working
- Search Query for multiple categories using ‘OR’ but having certain categories be ‘AND’
- query_vars overriding WP_Query args
- how can I override The Events Calendar query modifications?
- Query all posts if multiple meta key don’t exist
- meta_compare not comparing whole integer
- How do I get my custom query to work with search results after the first page?
- Modify Search Query if original Query gave no results
- wp_query to print posts if have X custom field value
- Why is WP_Query not displaying expected data?
- Include post content of linked posts in search
- Prevent author bio page from showing in search results
- How do I amend wp_query before it is run/executed?
- Order post type by sum of two custom fields
- WordPress Custom Search Form Displaying Unexpected Results
- How to properly use AND / OR in custom search
- How to order posts on each different category?
- How do you determine if a result in a search query is a post or a page?
- Get every post with value in meta key
- Using get_posts to get posts based on a checkbox value with Advanced Custom Fields
- Slow Query On Search
- How To Keep Search Title the same on paged Results
- Order WP_Query results by meta key value in custom query
- Excluding posts with certain value of meta_key keeping posts without that meta_key
- How to restrict search on a certain page to only return results against custom taxonomies?
- Filter out a meta key in the Search results page with two CPT
- Query by key or author
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- Sorting posts by Multiple custom fields in defined order
- Can I make a search query which includes a space?
- My combination of ‘post_type’ and ‘tax_query’ not working?
- How to add a “base” filter for all posts visible to visitors on the site?
- Sort custom post by custom field if none order by latest release
- WP_Query no result if keyword contains number
- Getting posts by custom field value
- ACF Post Object meta-query by title not ID
- getting posts by tags
- Custom Post Type WP_Query with filters and search
- WordPress search page pagination displaying but not functional
- Search has query that will return no results
- From admin edit user page query either the user_nicename or username field value of the user profile being edited or viewed
- WP Query – Search in title or author_name
- Get posts by similar names and categories
- Query by meta value (add a dropdown of all values)
- Order Posts By Custom Field That is an array of objects
- Custom WP_query and integrating into theme file
- Query by Category and Custom Field – Shortcode
- Querying posts with meta key and meta value not returning anything
- WP_Query with Pagination and orderby meta_value_num showing duplicates
- Mathematical operations on custom field values? (updated)
- Compare meta key separation
- WP_Query a custom field value bringing back 0 results
- new WP_query using custom fields
- $wp_query when new WP_Query
- Need help setting up a search form for wordpress [duplicate]
- query_posts with sorting on a custom datestamp
- Query posts filter not working
- Display all custom meta field values from the database using ACF Repeater
- Taxonomy related query not working
- Filtering product search results using tags
- WordPress WP_Query Search (‘s’) With Multiple Search Terms
- Search results stuck on page 1
- Custom Taxonomy in custom REST API search
- WP_Query sort by ACF date field (newest first) with blank dates first