Why not just get the count for each post type and sum them?
function get_all_them_ven_posts(){
$count= 0;
$post_types = [ 'postType1', 'postType2', 'postType3' ];
foreach( $post_types as $post_type ) {
$count_posts = wp_count_posts( $post_type );
$count = $count + $count_posts->publish;
}
return $count;
}
Related Posts:
- How to mark every 3rd post
- Count posts within a custom post type and specific taxonomy and terms?
- How to Display a List of Users Who Have Made at Least 1 Post?
- How to Display Network Post Count?
- How to cache a shortcode functions output?
- Count posts in category including child categories
- Count singular post views automatically
- Set font size automatically according to number of words in post
- Network wide post count (WP Multisite)
- Redirect based on user post count
- Alternate custom content in the loop
- Show that current post is number X out of X
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- Double count view in archive.php
- Count to how many categories a post belongs to
- Count search results in heading
- How to hide first gallery for every post?
- Counter of posts ever posted – even deleted ones
- Display Published Posts Count for Certain Time Period
- How can I get global $post to work for CPT and update user?
- Display Notification Bar on Header on Certain Post Count
- Show posts count for Categories and Tags in wp_nav_menu
- How to add category post count in main navigation menu [closed]
- Count number of posts of current month
- Howto show comment count by post in post?
- Counter is skipping post when I still want it visible [closed]
- Count several post tags
- Get post number both in the loop and in the post
- How do I insert a after every 5 posts in a WordPress Loop that infinitely loads posts?
- Count the number of a post types associated with another post type
- Echo the number of posts being displayed
- Display amount of pending posts in back/front end
- Count user posts and store the number for later use
- why the posts queried from sql is more than those showed on the page?
- Count the total views of all user posts published
- Author post count in category
- Set post title font size automatically according to number of words in post title
- Show post count in custom taxonomy page
- Count singular post views automatically
- How to count posts in tags within time limit
- Display Custom Post Category Count & WordPress Category Count Using Shortcode
- Counting Posts by Category
- Display number of post published every day
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- Alternative content between posts no repetition
- count_posts to a standalone link
- How to control Post view count incresing in sidebar widget posts too?
- How to mark every 3rd post
- Add a minimum word count to Excerpt (and how to force Excerpt as a rule for WyPiekacz)
- How to limit the number of posts a user can publish based on user type
- ho can I get the number of the current post instead of the post id?
- post_count not working
- Adding Count Post in Page
- Count words for all posts by all authors
- Word count for all posts of all authors
- Display post count on archive page in reverse order
- Determine if page is the Posts Page
- How to get ‘post_content’ without stripping tags?
- Post featured image column on admin post list page
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- How to Sort Custom columns in admin
- Shortcode Not displayed at the Right Place [duplicate]
- is there a better way of combining this?
- How to output comments number of a post per day?
- get_permalink executes link without https
- Auto Refresh Post List after X seconds
- Display posts with comments closed, with pagination?
- WordPress blog post cloned and stolen?
- What is the Better way to manage posts in WordPress?
- Why won’t my taxonomy query show up?
- How to show single post page as home page
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Get more than one author’s posts with REST API
- More then one menu items are assigned with “current-menu-item” class
- How can i delay reading posing in 3days for not logined user?
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- Nested WP_Query breaking loop
- How to create wordpress class with post meta? [closed]
- Custom taxonomy archive page problem
- post__in not working with pre_get_posts, but post__not_in does work
- Blog page error ‘Index of /blog’
- tribe_get_start_time displays the current date and time on other post types than tribe_events
- How to get the latest URL of my blog?
- Hide parts of the post content after typing it’s name or searching it by category
- search content of pages and list in wp-admin
- get parent fields title, content excerpt etc
- Changing permalink of WordPress
- Rest API Paginate until all posts are imported
- How to find the edit link of the WordPress Post from the URL
- Blog Page doesn’t show summary but full content
- Get posts from category from custom query
- Changing a users posts to drafts upon role change
- Show 5 posts and than 3 posts offset with pagination
- Start loop from specific post ID
- Connection dropped due to file size
- How to Get Position of a Post from a category and tag
- Custom author search
- Combining multiple conditional statements [closed]
- Is there a block to print post link standalone in a block theme?
- Export Posts Without Categories In An XML File