Parent-route listing Query Loops are not scoped to their section's posts
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start in WordPressSitePlan::materializeListingQueryLoops(), where posts are grouped by parent route, and at listingQueryMarkup(), which emits the inherit: false query with no section filter. Trace how postsByParent already proves membership, then decide how to carry it to WordPress (a generated category per parent route with a taxQuery, or another mechanism). Done when a multi-section site's /news/ listing query only returns /news/ posts and single-section output is unchanged. The issue leaves the approach open, so confirm the design with the maintainer first.
Written by the indexing model from the issue text.
Description
Summary
WordPressSitePlan::materializeListingQueryLoops() groups posts by their parent route (/news/<slug>/ belongs to /news/). The Query Loop it emits for a parent-route listing (listingQueryMarkup()) has inherit: false and no section filter, though: postType: post, ordered by date, with nothing else. On a site with more than one post section (for example /news/ and /blog/), each listing page therefore shows the newest posts from every section, not its own.
Observed on a real import: the /news/ listing rendered posts from /blog/ between its own news posts.
The parent-route membership is already proven when the cards are matched (postsByParent). It is not carried to WordPress, as a term, a post-meta key or an include list, so the query cannot reproduce it. Category archives (#2468) carry term membership. Parent-route sections don't.
Expected
When a site has more than one post section, a section listing's Query Loop is scoped to that section's posts. One way is a generated category per parent route with membership on each post, and a taxQuery on the listing query. Single-section sites keep today's output.
Notes
- Related: #2884. The fix for that issue keeps listings captured when posts still carry their page chrome, which hides this on the site where it was found. It shows again whenever article factoring succeeds for a multi-section site.
AI disclosure: Claude (Anthropic) via Claude Code implemented this under Chris Huber's direction; operator-authorized direct fallback outside Homeboy.
- Dominant language
- PHP
- Stars
- 21
- Forks
- 2
- Avg merge
- 9h 6m
- Merged PRs (30d)
- 589
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/blocks-engine
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#2161 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/blocks-engine#2061 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#1701 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Automattic/blocks-engine#775 ·
Maintainers usually reply within 1 day
-
Class-hidden phone menu restored as a resting panel without a togglePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 75/100
Automattic/blocks-engine#3051 ·
Maintainers usually reply within 1 day
All issues in Automattic/blocks-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Spomky-Labs/pwa-bundle#476 ·
-
domain/discovery
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
code4romania/cpc#64 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day