If you were to use WP_Query to retrieve a list of posts, you can then access the number of posts using ‘found_posts’.
e.g. (from the support pages)
$query = new WP_Query( array( 'author' => 123, 'post_type' => 'posts_comcurso' ) );
Would return all posts with a userid of 123 in your selected post type. Then access the number of posts like so:
$count = $query->found_posts;
There may be other ways but the above gives you a lot of flexibility to target the posts you want to count.
Related Posts:
- How to apply order on custom taxonomy and custom meta key on custom post type
- what is the correct way to compare dates in a WP query_posts meta_query
- Redirect after deleting post and keep track of pagination
- Query posts by custom post type and custom taxonomy
- Query post types with multiple keys
- Remove POST_TYPE from custom post type permalink
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- Get all posts WHERE custom_field is LIKE value
- Custom Post Type | Fatal Error on register_post_type()
- Setting posts per page in query_posts
- How to insert content from another Custom Post type into Post?
- Get rewrite slug of custom post type in template
- How to customize a permalink (URL) structure?
- Plugin: register custom post types, child ready and performance best practices
- Display only one post each WEEK
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- attach CPT data to a taxonomy
- How to insert data into meta box from another plugin?
- Convert Custom Table Data Based Plugin To Be Searchable
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Create a post automatically if search result has zero results
- Registering an optional custom post type from a plugin
- Add category slug as class attribute in a link array
- Add Excerpt On Quicksand Plugin
- Multiple Block Quotes without using HTML
- What’s the best way to show custom post types? With page template it’s not perfect!
- Inserting two categories
- Set a Custom Post Type as a Homepage
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- How to post twitter like updates on wordpress
- Show Two custom Post type and their posts on category page
- How to get all `supports` attributes by post type?
- How to create an advanced filter search?
- Custom search for custom post meta with pre_get_posts interferes with WP search
- Get all of user’s custom post types in WP Admin for plugin
- Issue with pre_get_posts on custom post type archive pages
- Assigning the same custom meta box to multiple post types
- Custom Post Type Navigation on Custom Field
- apply filters only to specific post listing without check the url parameters
- Combine query_posts() and get_posts() into single query
- Dynamically add / duplicate custom meta in custom post types
- WordPress if in term*
- how can i get posts from custom post type particular taxonomy category
- Custom post type and body_class: Remove “blog” class
- Plugin translation not working apart from name and description
- Weird problem happening with custom taxonmy when creating/updating posts
- Placeholder in HTML editor text area?
- Custom Post Type rewrite
- Deleting Custom Post type data using mySQL command
- Admin notice not displaying
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- How can I create a custom meta box to add an mp4 video to a page?
- Custom Post Type: Upload Multiple Images
- Sort by custom field is not working
- Custom query works but returns “Undefined Offset: 0”
- Delete link on single-custom.php with redirection
- How to structure a site with product variations pages?
- Detect where custom post type is declared
- CPT: if more than X images are in post, use pagination
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Sorting multiple custom post types without a meta key/value pair by sort order
- Custom post types instead of regular post’s categories in a page template
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Change or update WordPress loop based on dropdown selection
- Getting rid of /my_custom_post_type/ in the single view URL
- Custom post type menu missing after 3.0b2 -> 3.1.2 upgrade
- Custom Post Type – List all attachments on Edit Screen
- Hook to override title, image and content
- Insert Multiple Post with Same Publish Button
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- Group posts by custom post type
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Custom Page that comes with preloaded content for the user
- get_object_taxonomies() returns empty array for custom post type
- How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?
- What’s a better alternative to this code?
- WordPress theme custom capabilities not works
- Display custom post type from dynamic custom field
- custom post type not showing in menu
- Custom posts don’t work
- Query/list all terms and their custom post count
- No posts found – Custom Post Type show_ui
- How to check post type (to include custom css)
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Adding a custom post type taxonomy template in plugin
- How to add a custom taxonomy to show up in a custom post type menu?
- List children on child post
- How to Mass Delete Images from Media Library
- How to query_post custom posts within default taxonomy?
- Get posts between custom dates
- child of post type (custom)
- Permalink structure by Post Meta value
- Give a permalink to Custom Post Types without title