dane-m
9/14/2013 - 5:16 AM

Count the number of posts currently published in a specific category, tag or custom taxonomy.

Count the number of posts currently published in a specific category, tag or custom taxonomy.

function posts_in_term($catid, $taxonomy) {
        $term_query = get_term($catid, $taxonomy);
        return $term_query->count;
}