Fox*_*nni 10
使用以下代码:
$taxonomy = "category"; // can be category, post_tag, or custom taxonomy name
// Using Term Slug
$term_slug = 'some-category';
$term = get_term_by('slug', $term_slug, $taxonomy);
// Fetch the count
echo $term->count;
Run Code Online (Sandbox Code Playgroud)