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 ;
}
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 Commented May 31, 2019 at 14:32

1 Answer 1

0

İ found a solution:

$posts = get_queried_object();
echo $posts->count;
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.