Query block in front end renders only the first element #25117
Labels
[Block] Query Loop
Affects the Query Loop Block
[Type] Bug
An existing feature does not function as intended
Describe the bug
Something recently broke the rendering of
Query
block in front-end. While the query block works as expected in FSE, when trying to view the page in front-end, only the first element is displayed.In some searching I've done, I noticed in
query-loop/edit.js
:$posts = get_posts( $query )
are correct$content
is not because it's missing thepost-content
s but do have allpost-titile
s. It still renders only the first one though.Also by changing the
query-loop/save.js
to return adiv
wrapper to apply the block's attributes ( which in this case isclass=wp-block-query-loop
), the rendered output in front-end is bothpost-title
andpost-content
but only for the first item..I have searched many recent PRs but I haven't found the cause of this and
WP_Block
class hasn't changed for a couple of months (https://github.com/WordPress/gutenberg/blob/master/lib/class-wp-block.php).To reproduce
Steps to reproduce the behavior:
Query
blockExpected behavior
Rendered parts/posts should be the same as in the editor
The text was updated successfully, but these errors were encountered: