Here is the code that I use to counts posts for one post_type, I would like to use multiple post_type ( post_type_1, post_type_2... ) anyone can help me doing this ?
Thanks for the help.
<?php global $wp_query; $curauth = $wp_query->get_queried_object(); $post_count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '" . $curauth->ID . "' AND post_type = 'post' AND post_status = 'publish'"); ?> <h2>Post Count: <?php echo $post_count; ?></h2>