Query Loop displaying incorrect number of posts in the Editor with "inherit query" enabled #71712
Labels
[Platform] Atomic
[Platform] Simple
[Pri] Low
Address when resources are available.
[Status] Core Fix Needed
A fix within the Core WordPress or Gutenberg project is required to resolve this issue.
Triaged
To be used when issues have been triaged.
[Type] Bug
Quick summary
On templates which default to using a Query Loop with the "Inherit query from template" setting enabled (e.g. Home, Index, Archive, Search, etc.), there can be a mismatch between the number of posts displayed in the Site Editor vs. the number of posts displayed on the live site. It seems this stems from any discrepancy between the "Items per page" setting on the Query Loop block (not accessible with "Inherit query from template" enabled) and the "Blog pages show at most" setting from
Settings > Reading
.Steps to reproduce
Settings > Reading
, set the "Blog pages show at most" setting to a small value (e.g. 5).Appearance > Editor
) and open one of the templates mentioned above.What you expected to happen
The number of posts displayed in the Editor should match what's displayed on the live site.
It seems odd/unexpected that you can't control the number of posts displayed in a Query Loop if the "Inherit query from template" setting is enabled, and instead a separate WP Admin setting is required to control that outside the Editor (which then doesn't reflect in the Editor).
What actually happened
As an example, in my testing, I had set "Blog pages show at most" to 5. The Query Loop on the Twenty Twenty-Two theme's Home template defaulted to displaying 8 posts per page, so 8 posts were displayed in the Editor. Only 5 appear on the live "latest posts" homepage.
Context
38832399-hc (with some discussion at p1671738151370229-slack-C03TY6J1A)
36734787-hc
Platform (Simple, Atomic, or both?)
Simple, Atomic
Theme-specific issue?
Doesn't appear theme-specific. Tested on Twenty Twenty-Two and Quadrat, user reports both came from Masu.
Browser, operating system and other notes
No response
Reproducibility
Consistent
Severity
Some (< 50%)
Available workarounds?
Yes, easy to implement
Workaround details
The number of posts on the live site for Query Loops with "inherited" queries is set in
Settings > Reading
. This can be made to match in the editor by disabling the "Inherit query from template" toggle, modifying the "Items per page" setting, and then re-enabling the toggle.The text was updated successfully, but these errors were encountered: