Skip to content

Cannot add any blocks to the Post Template block if no posts currently published on the site.  #50696

Open

Description

Description

It seems that the Post Template block doesn't allow you to add any new blocks as Inner Blocks if there are no published posts currently on the site.

Today I created a clean install of WordPress, with the twenty twenty three theme to begin a new site today, cleared out the default plugins/themes, removed the Hello World post from the site, went to create my home.html blog template in the site editor and frustratingly couldn't add any new blocks to the Post Template block.

After an hour of frustration and trying to troubleshoot this, and after restoring and publishing the Hello World default post, I was able to add new blocks to the Post Template block.

Setting up the template shouldn't be dependant on anything. If there are no posts present on the site it can simply fall back to the No Results block, but the Post Template block shouldn't be blocked from setting up however I want in the meantime.

This behaviour was extremely confusing and time costly today trying to understand what was happening.

Step-by-step reproduction instructions

  1. Install WordPress using any theme
  2. Ensure the Hello World post is either set as a draft or deleted leaving no published posts
  3. Edit either the template in the site editor or any page
  4. Add the core query loop block (which adds the Post Template block)
  5. Try to add new blocks to any variation of the query loop block inside the Post Template block

It can't be done.

Screenshots, screen recording, code snippet

chrome-capture-2023-4-17.webm

Environment info

  • WordPress 6.2 / WordPress 6.2.1
  • Any Theme

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

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

Metadata

Assignees

No one assigned

    Labels

    [Block] Post TemplateAffects the Post Template Block[Block] Query LoopAffects the Query Loop Block[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