Title: PAGINATE TEMPLATE
Last modified: August 19, 2016

---

# PAGINATE TEMPLATE

 *  [BBustamante](https://wordpress.org/support/users/nasgor/)
 * (@nasgor)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/paginate-template/)
 * Hello.
    I’m using WordPress 3.0.5. with a child theme of Twenty Ten (created 
   by me) installed, it has not many modifications to the original. I created a 
   template to display a history of my posts in a page. Everything seems to work
   correctly, but I dont know how to paginate it. I would love to show in 50 posts
   groups whith the pagination at the end. Any body could hel me?
 * I leave the code that I have prepared below.
 * [http://wordpress.pastebin.com/WYskqsLw](http://wordpress.pastebin.com/WYskqsLw)
 * Thank you very much.
    Nasgor _[sig moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome)]_

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/paginate-template/#post-1917401)
 * Why are you querying the database directly
 *     ```
       <?php
       $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");
       if (0 < $numposts) $numposts = number_format($numposts);
       ?>
       ```
   
 * instead of using query_posts?
 * [http://codex.wordpress.org/Function_Reference/query_posts](http://codex.wordpress.org/Function_Reference/query_posts)
 *  Thread Starter [BBustamante](https://wordpress.org/support/users/nasgor/)
 * (@nasgor)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/paginate-template/#post-1917451)
 * That was a code I found online and modified. That’s why the code was with that
   format. But I’ve improved it. Even so, I still do not know how pageinate the 
   results in the template. If anyone can help me or give me a hint I’d appreciate
   it very much.
 * Here is the code.
 * [http://wordpress.pastebin.com/CjKsKhZw](http://wordpress.pastebin.com/CjKsKhZw)
   
   Thank you very much. Nasgor _[sig moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome)]_
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/paginate-template/#post-1917455)
 * See the link I gave above.

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

The topic ‘PAGINATE TEMPLATE’ is closed to new replies.

## Tags

 * [pagination](https://wordpress.org/support/topic-tag/pagination/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 3 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/paginate-template/#post-1917455)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
