Title: Change posts_per_page inside loop?
Last modified: August 20, 2016

---

# Change posts_per_page inside loop?

 *  [Twansparant](https://wordpress.org/support/users/twansparant/)
 * (@twansparant)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/change-posts_per_page-inside-loop/)
 * Hi there,
 * I’ve got a problem I can’t seem to solve…
    On a page displaying posts from a 
   custom post type called ‘news-item’, I want to change the number of posts displayed
   on page 2 and further. This because I want the newest (first) post displayed 
   bigger then the rest, but therefore the layout/grid has to change too. So for
   example:
 * **On Page 1:**
    1 Large post 4 normal posts ————— 5 total
 * **On Page 2:**
    6 normal posts ————— 6 total
 * The part that the first post has to be bigger on page 1 works, but I can’t seem
   to change/set/update the **posts_per_page** parameter inside the loop in order
   to add it with 1. Is that even possible without making a second wp_query?
 * I tried it with:
    `set_query_var( 'posts_per_page', 4 );` and: `$args -> set('
   posts_per_page', 4 );` but that’s not working and messing up my pagination.
 * My code: [http://pastebin.com/hR6K4Wtj](http://pastebin.com/hR6K4Wtj)
 * ANY help is welcome!
    Many thanks!

Viewing 16 replies (of 16 total)

[←](https://wordpress.org/support/topic/change-posts_per_page-inside-loop/?output_format=md)
[1](https://wordpress.org/support/topic/change-posts_per_page-inside-loop/?output_format=md)
2

 *  [Yonyoh](https://wordpress.org/support/users/yonyoh/)
 * (@yonyoh)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/change-posts_per_page-inside-loop/page/2/#post-2277367)
 * thanks for sharing.

Viewing 16 replies (of 16 total)

[←](https://wordpress.org/support/topic/change-posts_per_page-inside-loop/?output_format=md)
[1](https://wordpress.org/support/topic/change-posts_per_page-inside-loop/?output_format=md)
2

The topic ‘Change posts_per_page inside loop?’ is closed to new replies.

## Tags

 * [First post](https://wordpress.org/support/topic-tag/first-post/)
 * [pagination](https://wordpress.org/support/topic-tag/pagination/)
 * [posts_per_page](https://wordpress.org/support/topic-tag/posts_per_page/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 16 replies
 * 5 participants
 * Last reply from: [Yonyoh](https://wordpress.org/support/users/yonyoh/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/change-posts_per_page-inside-loop/page/2/#post-2277367)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
