custom post type and user post count shortcode

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.

Here’s the link to WP_Query support page