I know how to count how many posts has a certain tag, or category
$term_slug = 'some-post-tag'; $term = get_term_by('slug', $term_slug, $post_tag); echo $term->count;
BUT! Is there anyway to count how many posts that have a tag AND a specified category?
I want to count how many posts that have the tag(slug) "cat" and the category slug "allowpost"
Is this even possible?
Edit: if possible, it would be good if this is manageable via some solution similarly my first script, because this is going to be used on search result pages, and different post pages, so adding something to the loop itself won't work..