Update query blocks in patterns to ignore sticky posts#9471
Update query blocks in patterns to ignore sticky posts#9471AKSHAT2802 wants to merge 3 commits intoWordPress:trunkfrom
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I looked at this PR, and while I think it functionally does what is needed, I think it may be doing more than is desired - the goal was to exclude sticky posts in templates that have multiple query loops, but it looks to me like this is excluding sticky posts in all templates. Is that what's actually desired, @poena? I don't think this will cause any problems with versions before 6.8. Based on @sabernhardt's testing notes, I looked at the code, and I don't see any reason this would throw an error on earlier versions. It won't work on earlier versions, but that's not a concern - it would just be the same as it is now. |
PR for : https://core.trac.wordpress.org/ticket/62975
Summary
This PR updates bundled theme templates (e.g., Twenty Twenty-Five, Twenty Twenty-Four) that use Query Loop blocks with an offset to set the default to ignore sticky posts.
Why
When a Query Loop with an offset does not ignore sticky posts, sticky posts can appear more than once in their designated sticky slot and again in the offset loop. This leads to duplicate content and a suboptimal reading experience.