My website: http://www.affordyourpassions.net
I have my blog set up with a slider on the front page; a featured post, and then 7 additional grid (magazine?) posts, for a total of 8 posts on the home page.
The front page content length aligns pretty closely with the sidebar content.
On the 2nd and subsequent pages, there are 8 posts per page, but without the featured image, or the featured post, the sidebar content extends much further, so there is a lot of white space.
Is there a way to change the number of posts on 2nd and subsequent pages, so that I have more grid posts so that it matches the length of the sidebar?
You wouldn't believe how difficult that is to do correctly. You need to use the pre_get_posts action to set the correct number of posts on the front page and then if is paged you set a different number of posts and use an offset to make sure things don't get missed. Because of the way the offset works you must have more posts on the first page and fewer posts on subsequent pages.
Getting more posts on subsequent pages doesn't work nearly as well because you can't do a negative offset
Thanks, Nick, for the prompt response! I'll either have to live with it, or do something about the sidebar
The topic ‘Changing # of posts per page on 2nd and subsequent pages…’ is closed to new replies.
Subscribe to get early access to new themes, discounts and brief updates about what's new with StudioPress!