Title: A problem with posts_per_page
Last modified: August 19, 2016

---

# A problem with posts_per_page

 *  [raphaelber](https://wordpress.org/support/users/raphaelber/)
 * (@raphaelber)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/a-problem-with-posts_per_page/)
 * Hi
 * I tried using one example I found in the codex in order to fix the number of 
   posts by page for a specific category.
 * Usually the number of posts per page is fixed in the reading settings section
   of the dashboard.
 * But thanks to a query, I should be able to change that number according to the
   category I want.
 * I added a <?php query_posts(‘posts_per_page=9’); ?> just before the loop. I had
   the most recent 9 posts but when I clicked on older entries I got the same most
   recent 9 posts.
 * Is posts_per_page working properly ?
 * Thank you

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/a-problem-with-posts_per_page/#post-1271262)
 * You need to add the ‘pagination’ stuff there
 *     ```
       <?php
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts($query_string .'posts_per_page=9&paged='.$paged);
       ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘A problem with posts_per_page’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/a-problem-with-posts_per_page/#post-1271262)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
