I want to know the total number of posts from the category/tag/author/search result that I am actually seeing.

Say for example I am in the main page. If my posts_per_page are 10 and my pagination shows 6 pages, that would mean there are a number of posts in my query between 51 and 60.

How could I get that exact number?

I would like it to work for every category,search results... from my web.

Thanks in advance!

1 Answer 1

<!-- displays total number of posts for query, ignoring pagination -->
<?php echo $wp_query->found_posts ?>

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.