postnumber
// Add Shortcode
function wt_get_category_count( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'src' => '',
'width' => '',
'height' => '',
),
$atts,
'catnum'
);
function wt_get_category_count($catID) {
global $wpdb;
$SQL = "SELECT $wpdb->term_taxonomy.count FROM $wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id=$wpdb->term_taxonomy.term_id AND $wpdb->term_taxonomy.term_id=$catID";
return $wpdb->get_var($SQL);
}
echo wt_get_category_count(2);
}
add_shortcode( 'catnum', 'wt_get_category_count' );