Title: Count Items in Loop
Last modified: August 20, 2016

---

# Count Items in Loop

 *  [itsonlybarney](https://wordpress.org/support/users/itsonlybarney/)
 * (@itsonlybarney)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/count-items-in-loop/)
 * I have created a Custom Post Type, and modified the archives loop to output just
   the link to the Custom Post.
 * Is it possible to count the number of items extracted from the database using
   the loop?
 * This is my loop query:
    `$loop = new WP_Query( array( 'post_type' => 'cclub','
   orderby' => 'title', 'order' => 'ASC' ) );`
 * I thought I could count the items using the count() function from PHP using the
   follow:
    `$count = count($loop);`
 * But alas the answer given was 1.

The topic ‘Count Items in Loop’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [itsonlybarney](https://wordpress.org/support/users/itsonlybarney/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/count-items-in-loop/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
