最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - Show post count in custom taxonomy page

programmeradmin1浏览0评论

How can I show the post count in a taxonomy page. I tried some codes but I could not get success. I will locate this information on the top of taxonomy page.

foreach ( get_the_terms( get_the_ID(), 'taxonomy' ) as $term )
{
  echo  $term->count ;
}

How can I show the post count in a taxonomy page. I tried some codes but I could not get success. I will locate this information on the top of taxonomy page.

foreach ( get_the_terms( get_the_ID(), 'taxonomy' ) as $term )
{
  echo  $term->count ;
}
Share Improve this question edited May 31, 2019 at 14:30 butlerblog 5,1313 gold badges28 silver badges44 bronze badges asked May 31, 2019 at 14:28 Ramin MahmudovRamin Mahmudov 511 silver badge12 bronze badges 1
  • I am using woody snippets plugin to insert php code to custom taxonomy page because i create custom taxonomies with post type builder plugin – Ramin Mahmudov Commented May 31, 2019 at 14:32
Add a comment  | 

1 Answer 1

Reset to default 0

İ found a solution:

$posts = get_queried_object();
echo $posts->count;
发布评论

评论列表(0)

  1. 暂无评论