How to display the number of published posts of any type in the current taxonomy, also custom? With taxonomy checking, that is, there should be one code for everyone.
I understand what and how it should work, but I can not write myself. According to the directory :
$count_posts = wp_count_posts('post'); $published_posts = $count_posts->publish; gets the number of published posts of a given type of 'post' in all categories. and More from the Internet :
echo get_category($ID)->category_count; displays the number of published posts in a category; in theory, something like echo get_taxonomy($name)->category_count; should have worked echo get_taxonomy($name)->category_count; , but no