Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 1 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
add comment

Your Answer

 
discard

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.