WordPress.org

Ready to get started?Download WordPress

Forums

Change posts_per_page after first page in custom loop (4 posts)

  1. Twansparant
    Member
    Posted 2 years ago #

    Hi everyone,

    I made a custom $wp_query in order to display my first post only on the first page differently then the rest. Because this first post is wider then the others, I want my grid to be different than on the other pages. So therefore I want my posts_per_page variable to be let's say 3 on page 1 (1 big post and 2 small posts) and 4 on the rest of the pages (4 small posts).

    Everything is working, except post 5 dissapears somehow and that confuses my wp_paginate resulting in an empty page 3.

    This is my code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Does anyone have an idea to solve this?
    Any help is very much appreciated!

    Thanks

  2. Twansparant
    Member
    Posted 2 years ago #

    Oeps, sorry!
    Here's my code in pastebin: http://pastebin.com/cam0uzVU

  3. Twansparant
    Member
    Posted 2 years ago #

    Anyone?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Hint: Try posting a new topic. :-)

Topic Closed

This topic has been closed to new replies.

About this Topic