$q = new WP_Query(array(
'posts_per_page'=>'-1',
'fields'=>'ids',
'post_type'=>'companycatalog',
'post_status'=>'publish',
'tax_query'=>array(
'taxonomy' => 'companycatalog-category',
'terms' => $taxids,
'field' => 'term_id'
)
));
$taxcount = $q->found_posts;
<?php $current_term_obj = get_queried_object(); {
$categories = get_queried_object();
$count = $categories->count;
$taxonomy = $categories->taxonomy;
$args = array(
'child_of' => $categories->term_id,
);
$tax_terms = get_terms($taxonomy, $args);
foreach ($tax_terms as $tax_term) {
$count +=$tax_term->count;
}
echo $count;
} ?>
$current_term_obj = get_queried_object(); {
$categories = get_queried_object();
$count = $categories->count;
$taxonomy = $categories->taxonomy;
echo $count;
}