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
1 Answer
Reset to default 0İ found a solution:
$posts = get_queried_object();
echo $posts->count;
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745445705a4628036.html
评论列表(0条)