I have an ACF multiple taxonomy field to specify featured categories. I am looping over this field to get those categories and display them with a post count like this:
<?php
foreach ($featured_categories as $category) :
?>
<?= $category->name; ?> (<?= $category->count; ?>)
<?php
endforeach;
?>
The issue I’m running into is that this is a shared taxonomy between two post types, so it is displaying the total post count across both of those post types. Is it possible to display the count based on a specific post type?