I am trying to display the number of posts made in custom post type "incidents" by the custom taxonomy "store".


Store 1: 8 posts

Store 2: 6 posts


I have been looking through here and only been able to find how to display the actual posts, which I do not need. Thanks for any help!


You could try running a custom query for each:

$args_1 = array(
    'post_type' => 'incidents',
    'post_status' => 'published',
    'posts_per_page' => -1,
    'tax_query'      => array(
            'taxonomy' => 'store',
            'field'    => 'name',
            'terms'    => 'store_1',
$count_1 = count( get_posts( $args_1 ) );

echo 'Store 1: ' . $count_1 . ' posts';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.