[wp-trac] [WordPress Trac] #58027: Post Content / Post Featured Image blocks break content if added before the loop

WordPress Trac noreply at wordpress.org
Fri Sep 1 17:30:17 UTC 2023


#58027: Post Content / Post Featured Image blocks break content if added before the
loop
-------------------------------------------------+-------------------------
 Reporter:  edge22                               |       Owner:  flixos90
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.4
Component:  Editor                               |     Version:  5.8
 Severity:  normal                               |  Resolution:
 Keywords:  has-testing-info has-patch           |     Focuses:
  gutenberg-merge                                |
-------------------------------------------------+-------------------------

Comment (by flixos90):

 In [changeset:"56507" 56507]:
 {{{
 #!CommitTicketReference repository="" revision="56507"
 Editor: Ensure main query loop is entered for singular content in block
 themes.

 Block themes currently lack the means to trigger the main query loop for
 singular content, since they cannot reasonably use the `core/query` and
 `core/post-template` blocks which are intended only for displaying a list
 of posts. So far, the missing main query loop on singular block templates
 has been worked around by enforcing the loop in certain `core/post-*`
 blocks, which however causes other bugs.

 This changeset ensures that the main query loop is still started for
 singular block theme templates, by wrapping the entire template into the
 loop, which will by definition only have a single cycle as it only
 encompasses a single post. This is currently the most reliable solution,
 since even if there were blocks to properly trigger the main query loop on
 singular content, it would be unrealistic to expect all existing block
 themes to update their templates accordingly. It may be revisited in the
 future.

 Props gziolo, youknowriad, joemcgill, costdev, mukesh27, flixos90.
 Fixes #58154.
 See #59225, #58027.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58027#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list