Skip to content

Update query blocks in patterns to ignore sticky posts#9471

Open
AKSHAT2802 wants to merge 3 commits intoWordPress:trunkfrom
AKSHAT2802:fix/adv-templates-twentytwentyfive
Open

Update query blocks in patterns to ignore sticky posts#9471
AKSHAT2802 wants to merge 3 commits intoWordPress:trunkfrom
AKSHAT2802:fix/adv-templates-twentytwentyfive

Conversation

@AKSHAT2802
Copy link

@AKSHAT2802 AKSHAT2802 commented Aug 13, 2025

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.

@github-actions
Copy link

Test using WordPress Playground

The 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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@AKSHAT2802 AKSHAT2802 marked this pull request as ready for review August 13, 2025 17:59
@github-actions
Copy link

github-actions bot commented Aug 13, 2025

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props akshat2802, joedolson.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@joedolson joedolson requested a review from carolinan February 14, 2026 21:46
@joedolson
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants