Title: Post count BEFORE the loop
Last modified: August 19, 2016

---

# Post count BEFORE the loop

 *  Resolved [brad_langdon](https://wordpress.org/support/users/brad_langdon/)
 * (@brad_langdon)
 * [16 years ago](https://wordpress.org/support/topic/post-count-before-the-loop-1/)
 * Just wanting to get the total count of all posts (not pages) which is simple 
   but I need the result before I start the loop.
 * Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years ago](https://wordpress.org/support/topic/post-count-before-the-loop-1/#post-1514057)
 * If you mean the total in the query (all, across however many pages).
 *     ```
       $wp_query->found_posts;
       ```
   
 *  Thread Starter [brad_langdon](https://wordpress.org/support/users/brad_langdon/)
 * (@brad_langdon)
 * [16 years ago](https://wordpress.org/support/topic/post-count-before-the-loop-1/#post-1514061)
 * Thanks, that did the trick.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Post count BEFORE the loop’ is closed to new replies.

## Tags

 * [count](https://wordpress.org/support/topic-tag/count/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [brad_langdon](https://wordpress.org/support/users/brad_langdon/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/post-count-before-the-loop-1/#post-1514061)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
