// @ WordPress
// Returns the total number of posts in given category
// --------------------------------------------------------
function count_total_posts($cat) {
foreach((get_the_category()) as $category) {
if( $category->cat_ID == $cat ) return $category->category_count;
}
}
//----------------------------------------------------------