how taxonomy list custom post count

by Ramin Mahmudov   Last Updated June 12, 2019 08:08 AM

i use $term->count to display post count but it display total count of all type of custom posts attached to taxonomy... i just want to display count of only a specific custom post type attached to taxonomy

$icon = get_field('logo', $term->taxonomy . '_' . $term->term_id); 
                        $va_category_HTML .= '<li class="logolar" '.$carrentActiveClass.'>' .'<a class="rownum">' .$i++. '</a>'. '</a>';
                        $va_category_HTML .= sprintf('<img src="%s" />', $icon) . '</a>';
                        $va_category_HTML .='<a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>';
                        if (empty( $instance['wcw_hide_count'] )) {
                        $va_category_HTML .='<span class="post-count">'.$term->count.'</span>';
                        }

                        $va_category_HTML .='</li>';


Related Questions



custom post type category count shortcode

Updated November 15, 2017 23:08 PM

How to create A-Z index listing for custom post types?

Updated December 21, 2017 07:08 AM

pre_get_posts gives 404 error on Custom Post

Updated July 03, 2017 20:08 PM