Skip to content

The latest posts block prints the block comment on the front when the full post is enabled #69427

Closed

Description

@carolinan

Description

When the latest posts block has the setting "Post content" enabled and set to full post, the block comment is printed on the front of the site.

In this example, the content of the post that is listed by the block has a single paragraph.
I copied this markup from the front of the site:

<div class="wp-block-latest-posts__post-full-content"><!-- wp:paragraph -->
<p>a sticky post!</p>
<!-- /wp:paragraph --></div>

(This is not a regression in 6.8)

Step-by-step reproduction instructions

Create a few posts.
Insert a latest posts block.
Save and view the HTML of the latest posts block on the front of the site.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. coder-rancho commented on Mar 5, 2025

    @coder-rancho

    I was not able to reproduce this issue even after downgrading the version to 6.7.

    Screen.Recording.2025-03-05.at.3.03.13.PM.mov
  2. carolinan commented on Mar 5, 2025

    @carolinan
    ContributorAuthor

    Are you looking at the source code? Its not part of the video.

  3. karthikeya-io commented on Mar 5, 2025

    @karthikeya-io
    Contributor

    Yes, I too can see the block comments in FE

    <div class="wp-block-latest-posts__post-full-content"><!-- wp:paragraph -->
    <p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>
    <!-- /wp:paragraph -->
    
    <!-- wp:heading -->
    <h2 class="wp-block-heading">test</h2>
    <!-- /wp:heading -->
    
    <!-- wp:image {"id":67,"sizeSlug":"large","linkDestination":"none"} -->
    ...
    <!-- /wp:image -->
    
    <!-- wp:paragraph -->
    <p></p>
    <!-- /wp:paragraph --></div>
    
  4. coder-rancho commented on Mar 5, 2025

    @coder-rancho

    I looked at the source code. I'm able to reproduce the issue.

    (This is not a regression in 6.8)

    • I'm able to reproduce it on Wordpress:6.8 as well:
    • I'm able to reproduce the issue even after deactivating the plugin:

    This seems like a issue with core and not with Gutenberg plugin.

    Screen.Recording.2025-03-05.at.4.20.55.PM.mov
  5. westonruter commented on Nov 7, 2025

    @westonruter
    Member

    I'm seeing this too, thanks to @sabernhardt.

    This issue becomes more pronounced in 6.9-beta4 because classic themes start to load block styles on demand (via Core-64099). Since the content for the posts listed in the Latest Posts aren't run through do_blocks(), it means the styles for those blocks never get loaded on demand. For classic themes up until 6.8 this wasn't an issue, because they were configured to not load styles on demand, meaning a stylesheet for the Cover block will be added to the page even if it isn't used. This was already the case for Twenty Twenty-Five:

    Expected Actual
    Image Image

    As of 6.9-beta4, the issue appears in classic themes as well:

    Expected Actual
    Image Image

    Reproduction steps:

    1. Create a new post called "Cover Block" with a Cover block as the first block
    2. Create a new page called "Post List" and add a single Post List block configured to show full content:
    <!-- wp:latest-posts {"displayPostContent":true,"displayPostContentRadio":"full_post"} /-->
    1. View the "Post List" page on the frontend. Notice the HTML output has the block comments present. Note also how in T25, the Cover block is unstyled. In contrast, in T21 in 6.8, the Cover block appears styled, whereas in 6.9-beta4, the Cover block appears unstyled. The lack of styling is due to the absence of the wp-block-cover stylesheet from being enqueued (and the wp-block-library is loading common.css instead of style.css).
  6. carolinan commented on Jul 10, 2026

    @carolinan
    ContributorAuthor

    I have retested after the merge of #74866 and this has been fixed.

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

Metadata

Metadata

Assignees

Labels

[Block] Latest PostsAffects the Latest Posts Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions