$num = $obj_name->post_count;
Reference: wp_query
Related Posts:
- How to Get All Posts with any post status?
- query_post by title?
- How to set posts per page using WP_Query()
- query_posts() in function makes global $wp_query out of sync?
- Problem with ‘post__not_in’
- Sort posts alphabetically by custom field value, insert divider between different letters
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- Custom Post Type “Event”: chronological list of recurring events
- Total Count of Posts NOT in Selected Categories?
- Order posts using a custom array
- Tricky WP Query
- WordPress pagination showing same posts on each page
- Search breaks when querying main loop for category
- Using ajax with paging and a custom sub-query
- Custom loops, sticky posts, and pagination nightmare
- odd behaviours from template tags
- Having an issue doing a WP_Query with post_content and category__and
- Custom query looking at multiple custom fields and properly sorting
- Pre-existing arguments when using queries
- How to refine WP-Query with further criteria
- Run second query on page based on author of the first query
- Query Posts (post meta)
- Using WP_Query to Query Multiple Categories with Limited Posts Per Category?
- How to query for most viewed posts and show top 5
- Ensuring sticky posts are retrieved first (without using two queries)?
- Determine if more posts are available than was asked for in `query_posts()`?
- How to exclude latest x posts from a paginated query?
- WordPress Custom Query to show posts from last x years
- Limiting query_posts to 1, regardless of sticky post?
- Perform query with meta_value date
- get_the_title($postID) OR get_the_title()?
- How should I intercept the main query and inject custom join / order by / group by criteria
- advice on creating a ‘related posts’ query like the one used on stackexchange
- Using dynamic conditions in ‘posts_where’ filter
- List users with the most total posts view
- Query not returning CPT posts
- get_post_meta causes database queries
- Unable to display multiple post types in same query (WPML WP_Query)
- Why is that gdsr_sort=thumbs (GD start rating plugin) only works with query_posts and not with WP_Query?
- Query_posts $query_string
- How to order posts by slug using query_posts/ Wp_query
- Order by meta_key with two meta_queries
- Search stores (custom postcode field) within 5, 10, 15 miles of user inputted postcode.. Code modification
- Hiding posts in a list from specified categories
- What is the difference between “manage_{$post_type}_posts_columns” and “manage_edit-{$post_type}_columns”?
- Multiple instances of Featured Image Query
- How to show only today’s post?
- use query_posts to return a post OR a page by ID
- How do you Query posts with nothing in common?
- ACF Custom Field WP_Query, but need to get all posts, if field doesn’t exist
- query_posts for child pages
- orderby:date not working
- Placing post data (title, date, and excerpt) nested in static content
- Store sticky post’s ids in a transient
- Single meta key with multiple meta value in like comparison
- list child page items (1 level with meta keys)
- Bypass “supress_filters” in WP Query
- Sorting a query Field by date
- Trying to package posts for republishing by partner offsite
- number of posts per page + random + exclude categories
- How to Query Post
- query_post and wpdb returning different results
- Exclude current sticky post
- Using WP_Query and Query_post for the loop?
- query_posts pagination will always show identical content
- WordPress Custom Query to get Most Commented Posts in the Past 7 Days
- Conditional operator OR not working with custom fields
- Get posts that do not have the same tags as current
- How to check in functions.php if there is data in a WP_Query?
- Should I reset $wp_query?
- Posts query according to meta box date
- Query function not executed between element [closed]
- Max Posts and Memory Limit
- Restrict query_posts by Date?
- How to solve this without flushing the rewrite rules for each post query the visitor triggers?
- Sort post by custom field numeric value
- Notting but the latest post content keeps on being loaded
- query_posts doesnt show pages with given ID when post_type => page
- How to put posts in pages using query posts
- Query add html after set amount of posts?
- Custom loop off by one post
- How to setup blog page to render blog posts minus afew categories
- Query post and sort by custom value calculated with custom field on cpt
- WP query_posts group by meta field related
- custom post type and a “sticky” position taxonomy
- WordPress sorting posts by date and title using a dropdown
- How to get max value of filtered query post
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- Ordering of posts, 2020 Year showing as next event when should be last
- Problem with my loops
- wp_query args with relation
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Modify query to exclude certain ids and certain parents and its corresponding children
- How to display most popular post by views count in WordPress?
- wp_query select if have comments
- query multiple posts by id using a string parameter, not array()
- Query posts in a category and include only one post per author?
- Does wp_query and query_posts affect website performance? [duplicate]
- Incorrect posts displayed on category page
- Assign a tag to custom post type using a query