functions.phpに記述します。
function count_user_posttype($userid,$posttype) {
global $wpdb;
$where = get_posts_by_author_sql($posttype, true, $userid,true);
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" );
return $count;
}
利用したい箇所に記述します。
<?php echo count_user_posttype(get_the_author_meta('id'),"post"); ?>


