Only display authors who have posts
The default version of the WordPress function provides the count of the default post type ‘POST’ as stated below: <?php $post_count = count_user_posts($userid); ?> For retrieving the post count based on a post type a custom function as below is required: <?php function count_user_posts_by_type( $userid, $post_type=”post” ) { global $wpdb; $where = get_posts_by_author_sql( $post_type, true, … Read more