I have 5 different custom post types, Is there any way to count all the publish posts regardless of post_type through any inbuilt functions
Like
wp_count_posts(array('post','books','video'))
any ideas
I have 5 different custom post types, Is there any way to count all the publish posts regardless of post_type through any inbuilt functions
Like
wp_count_posts(array('post','books','video'))
any ideas
Comments are closed.
To get the custom post types you would call the
get_post_types
function.The built-in public post types are post, page, and attachment. By setting ‘_builtin’ to false, we will exclude them and show only the custom public post types. Below is the code.I use to add all post
Just try this and reply whether it worked out this will give all pusblish posts ..