I would like to show the number of posts on the category page. How is it possible? I tried to find a solution but no luck..
Thank you!
3 s
If you are on a category archive you don’t need to query all the posts of the category like Christopher Ross suggested and you can’t use get_the_category()
like Max Yudin suggested unless you are already in the loop.
What you can do is simply get the current category object using get_queried_object()
which will hold the post count, ex:
$category = get_queried_object();
echo $category->count;