Output post count per category on a custom taxonomy archive

[ad_1]

My website has a taxonomy artists, under which artist names serve as terms. I’m on a taxonomy term archive for an artist. I am already able to display posts that belong to the current term. I put as <div> the following:

Album reviews

EP reviews

Track reviews

Interviews

I want these to display the number of posts that belong to the current term and are in the said categories.

Album reviews (x)

EP reviews (x)

Track reviews (x)

Interviews (x)

Where x is a number from 0.

Here’s my code and what I aim to accomplish:

<div id="track-and-album-rev" class="track-and-album-revs">
<?php if(has_term($term, 'artists')) {
echo '<h1 style="display:table">Album reviews';
echo '<span style="display:table-cell; font-size:20px; vertical-align:middle">&nbsp(';
I need to output the post count of the category "album-reviews" here;
echo ')</span></h1>';
echo do_shortcode('[display xxx]');
}
xxx and so on...

Any advice is highly appreciated!

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer