我有个问题。
如何计算某个标签的帖子数量?
例子 :
标记照片 (67)
Thanks
使用下面的代码:
$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;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)