You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sticky Post does not work correctly with loop (2 issues!) #80624
So far (including 7.0.1) it worked as expected:
first page: 1 sticky, 11 posts (newest first)
second page: 12 posts and so on
sticky post with an elder date did not appear on page 2
With 7.0.2:
first page: sticky post, 12 posts
second page: 12 posts but again the sticky post (so it appears twice)
I do not use anything special, Theme Abisko and the loop ist simply "standard" as in the theme
Step-by-step reproduction instructions
Wordpress 7.0.2, Theme Absiko, use out of the box and make a sticky post to see this strange behaviour
I have only my prod page
Screenshots, screen recording, code snippet
No response
Environment info
Wordpress 7.0.2 DE
Theme Abisko from Anders Noren
Browser: Chrome and Firefox
Device: Macbook Air 2026 and iPhone 17
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Please confirm which theme type you used for testing.
The sticky post does not remain at the top of the posts list as expected. Instead, it is listed as a normal post according to its publish date rather than being displayed at the top of the loop.
=== Environment
WordPress: 7.1-beta3, 7.0.2, 7.0
PHP: 8.2.29
Theme: Twenty Twenty-Five
Plugins:
Gutenberg 23.6.0
Query Monitor 4.0.7
WordPress Beta Tester 4.0.0
=== Steps to Reproduce
Created few dummy post with different dates. Had 10 post per page.
Made one of the post as a sticky post.
Moved from one page to another.
=== Expected Results
The sticky post must be at the top of the list.
can you please check if you have also one post more on the first page (as in my example 13 instead of 12), because the sticky post is somehow not counted.
For me the sticky post does appear at the top as the first post on both pages. The weird part is it is not considered as one of the 12 items set as the "Items per page"
Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.
Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.
Created 8 sequential posts and marked the oldest post as Sticky.
Inserted a Query Loop block with perPage = 3.
Page 1: Returns 4 posts ([Sticky Post 1, Post 8, Post 7, Post 6]) — sticky post is prepended as expected.
Page 2: Returns 4 posts ([Sticky Post 1, Post 5, Post 4, Post 3]) — Bug confirmed: Sticky post is repeated at the top of Page 2, and the page exceeds the 3 items limit.
Page 1: Returns 4 posts ([Sticky Post 1, Post 8, Post 7, Post 6]).
Page 2: Returns exactly 3 posts ([Post 5, Post 4, Post 3]) — Fix confirmed: Sticky post is excluded from page 2 and only appears on page 1.
Root Cause & Core Alignment
build_query_vars_from_query_block() paginated custom queries using only offset, leaving paged unset. WP_Query defaults $page = 1 when paged is omitted, causing $page <= 1 to evaluate to true on all paginated requests and prepending sticky posts to every page.
Activity
wdjina commentedon Jul 23, 2026
The sticky post does not remain at the top of the posts list as expected. Instead, it is listed as a normal post according to its publish date rather than being displayed at the top of the loop.
=== Environment
=== Steps to Reproduce
=== Expected Results
The sticky post must be at the top of the list.
=== Actual Results
It is listed as a normal post.
iritfab commentedon Jul 23, 2026
can you please check if you have also one post more on the first page (as in my example 13 instead of 12), because the sticky post is somehow not counted.
Swanand01 commentedon Jul 27, 2026
For me the sticky post does appear at the top as the first post on both pages. The weird part is it is not considered as one of the 12 items set as the "Items per page"
Environment:
WP: 7.1-alpha-62569
Theme: Twenty Twenty-Five
Editor:

github-actions commentedon Aug 27, 2026
Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.
iritfab commentedon Aug 27, 2026
This still does not work correctly, issue not solved with newer versions
github-actions commentedon Sep 28, 2026
Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.
iritfab commentedon Sep 28, 2026
This still does not work correctly, issue not solved with newer versions
Vrishabhsk commentedon Sep 28, 2026
hi @iritfab @wdjina
Let me know your thoughts on it. Thanks
robelsust commentedon Oct 7, 2026
Test & Review Report
Tested the reproduction steps and PR #83604 locally against WordPress trunk.
Environment
Reproduction (Before Fix)
perPage = 3.[Sticky Post 1, Post 8, Post 7, Post 6]) — sticky post is prepended as expected.[Sticky Post 1, Post 5, Post 4, Post 3]) — Bug confirmed: Sticky post is repeated at the top of Page 2, and the page exceeds the 3 items limit.Verification (After PR #83604)
[Sticky Post 1, Post 8, Post 7, Post 6]).[Post 5, Post 4, Post 3]) — Fix confirmed: Sticky post is excluded from page 2 and only appears on page 1.Root Cause & Core Alignment
build_query_vars_from_query_block()paginated custom queries using onlyoffset, leavingpagedunset.WP_Querydefaults$page = 1whenpagedis omitted, causing$page <= 1to evaluate totrueon all paginated requests and prepending sticky posts to every page.Setting
pagedin thequery_loop_block_query_varsfilter in PR #83604 cleanly resolves this and aligns with WordPress Core PR WordPress/wordpress-develop#8750 (Trac #63365).LGTM!
iritfab commentedon Oct 7, 2026
I was not able to test the solution (sorry, no developer - I am kind of advanced user). But this sounds good.
Dibyajyotikabi commentedon Oct 15, 2026
Reproduced both problems on WP 7.1.3 + Gutenberg 24.2.0 (Twenty Twenty-Five, Chrome 154 on Linux).
Setup: Query Loop not inheriting the query, 4 per page, newest first, sticky posts set to Include, one older post marked sticky.
?query-1-page=2).Happy to test #83604 against the same setup.