• Hey there,

    i discovered a strange behavior with sticky posts in wordpress.

    when i have sticky posts, they’re added to the max posts per page, right? but when i have more than 3 it looks like there not added anymore. all other sticky posts are taken off from he max posts per page.

    For example:

    I set 12 posts per page and i have 3 sticky posts. now it displays 15 posts on the first page of the blog. now when i add another sticky post, there are still 15 posts displayed, but now 4 sticky and 8 normal posts.

    or:

    9 stickys, 12 posts per page, 16 posts displayed.

    or:

    9 stickys, 20 posts per page, 22 posts displayed.

    I really don’t understand how it’s been calculated. this makes no sense at all.

    Does anyone have problems with this too?

    thx,
    felix

Viewing 6 replies - 1 through 6 (of 6 total)
  • Can you replicate this using the default 2012 theme with all plugins deactivated?

    Thread Starter Felix Hirschfeld

    (@felixhirschfeld)

    i disabled all plugins and using the deafult 2012 theme.

    i tested this:

    3 stickys, 12 posts per page, 15 displayed

    4 stickys, 12 posts per page, 15 displayed

    3 stickys, 20 posts per page, 21 displayed

    9 stickys, 12 posts per page, 15 displayed

    9 stickys, 20 posts per page, 21 displayed

    i really don’t understand this

    I think it depends upon whether any of the stickies would normally be on the front page anyway. If they were on the front page, they’re only shown as sticky and not in the normal date order. If they would have been on page 2, then they are stickied and shown on page 2. All of this can affect the number of posts being displayed on page 1.

    Does that make some kind of sense?

    I’m going to take a stab, and guess that the difference is whether the sticky posts are on the first page, or subsequent pages, in the current pagination.

    Of the 3 sticky posts, 2 are on page 2, and one on page 3, with 12 posts per page?
    Of the 4 sticky posts, 1 is on page 1, 2 are on page 2, and 1 is on page 3, with 12 posts per page?

    Of the 9 sticky posts, 3 are on page 1, and 6 are on subsequent pages, with 12 posts per page?
    Of the 9 sticky posts, 8 are on page 1, and 1 is on a subsequent page, with 20 posts per page?

    I believe that WordPress pulls sticky posts out of the normal post flow, including posts per page/pagination. If the sticky posts would normally fall on the first page with the current pagination, then the number of posts displayed on the first page will be unaffected. But, if the sticky posts would normally fall past the first page with the current pagination, the first page will display more posts than the posts_per_page setting.

    Cool! That’s exactly my understanding of the situation too – only your explanation was much better than mine. ??

    Thread Starter Felix Hirschfeld

    (@felixhirschfeld)

    OK now it all makes sense ??

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Strange sticky posts and posts per page calculation’ is closed to new replies.