Title: Count posts
Last modified: August 21, 2016

---

# Count posts

 *  Resolved [diego_circo](https://wordpress.org/support/users/diego_circo/)
 * (@diego_circo)
 * [12 years ago](https://wordpress.org/support/topic/count-posts/)
 * Hi! I want to count the posts and I don´t know how to do.
    I rewrite in my theme
   the file to customize your plugin but I´m in trouble with the count of posts 
   to make columns in my design. Any help? Thanks! Regards
 * [https://wordpress.org/plugins/posts-in-page/](https://wordpress.org/plugins/posts-in-page/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Patrick Jackson](https://wordpress.org/support/users/pjackson1972/)
 * (@pjackson1972)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/count-posts/#post-4987676)
 * Hi Diego_circo,
 * This isn’t part of the plugin’s API, so I can’t guarantee that this will still
   be available in future versions of the plugin, but the WP_Query object is available
   in the template as **$ic_posts**.
 * So **$ic_posts->post_count** will give you the total number of posts being listed.
 * If you want the current post number, use **$ic_posts->current_post**. Note that
   it starts counting at zero, so you may want to add 1 to it.
 * If you added the following to the top of your custom _post\_loop\_template.php_
   file (right under <div class=”post hentry ivycat-post”>)…
 *     ```
       <!-- This will output the post number and total posts  -->
       <div class="post-count">
           <p><?php  echo $ic_posts->current_post + 1; ?> of <?php  echo $ic_posts->post_count; ?> posts</p>
       </div>
       ```
   
 * … and you were listing, say, 3 posts; you would get something that looked like…
 * 1 of 3 posts
    … (post 1 content) …
 * 2 of 3 posts
    … (post 2 content) …
 * 3 of 3 posts
    … (post 3 content) …
 * You can check out more Methods and Properties of the $ic_posts (WP_Query) object
   in the codex:
 * [http://codex.wordpress.org/Class_Reference/WP_Query#Properties](http://codex.wordpress.org/Class_Reference/WP_Query#Properties)
 * Note that it’s called $the_query in their examples.

Viewing 1 replies (of 1 total)

The topic ‘Count posts’ is closed to new replies.

 * ![](https://ps.w.org/posts-in-page/assets/icon-256x256.png?rev=1596190)
 * [Posts in Page](https://wordpress.org/plugins/posts-in-page/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-in-page/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-in-page/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-in-page/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-in-page/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-in-page/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Patrick Jackson](https://wordpress.org/support/users/pjackson1972/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/count-posts/#post-4987676)
 * Status: resolved