WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
up vote 2 down vote accepted
<!-- displays total number of posts for query, ignoring pagination -->
<?php echo $wp_query->found_posts ?>
share|improve this answer
Thank you very much! – Alvaro Jul 19 '12 at 16:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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