Use this code on your themes functions.php to add current category id on body and post [php] function category_id_class($classes) { global $post; foreach ((get_the_category($post->ID)) as $category) $classes[] = ‘cat-‘ . $category->cat_ID . ‘-id’; return $classes; } add_filter(‘post_class’, ‘category_id_class’); add_filter(‘body_class’, ‘category_id_class’); [/php]
Get custom post count in custom taxonomy
To get total custom post count of a custom taxonomy use the follow code [php] $args = array( ‘post_type’ => ‘post type name here’, ‘post_status’ => ‘published’, ‘taxonomy name here’ => ‘slug of the category under taxonomy’, ‘numberposts’ => -1 ); echo $num = count( get_posts( $args ) ); [/php] For instance, if you had […]