Support » Plugins and Hacks » Hacks » Change Posts Per Page when Paginated

  • Is it possible to alter the posts per page according to whether or not you’re on the homepage or a paginated archive of the home page?

    This is my issue. My index page is a grid of ten post thumbnails, i.e., 2 rows of 5. On the homepage, I have a feature post and then 9 regular posts, for a total of ten posts. For this to work, in the reading panel I have to set “blog pages to show at most” to 9 because, apparently, the feature post (which is in its own loop) doesn’t count toward the max posts.

    Which is fine until I click the next_posts link. Now the feature post goes away (which is what it should do) and I’m left with only 9 posts and a broken grid (a row of 5 and 4, instead of two rows of 5).

    Is there a way to alter the max posts according to whether you’re paginated or not?

    Thanks.

Viewing 1 replies (of 1 total)
  • esmi

    (@esmi)

    Forum Moderator

    Is it possible to alter the posts per page according to whether or not you’re on the homepage or a paginated archive of the home page?

    Yes – using a mixture of query_posts and some conditionals.

Viewing 1 replies (of 1 total)
  • The topic ‘Change Posts Per Page when Paginated’ is closed to new replies.