0

Not sure if this specific question has been asked before. So regret repeating it here again.

My WP version: 6.2

My usecase -- I am unable to add blocks within blocks. Mostly I do not get option to add other core and custom blocks most commonly inside list items.

Is there a way to remove this restriction (via code change or plugin) to allow any block to be added within other blocks?

2
  • Currently facing the same issue in WordPress 6.4.1 especially while trying to edit a loop template. Dec 1, 2023 at 10:01
  • this isn't something supported by core at the moment, the core/list block would need to be adjusted. I'd recommend raising a github issue on wordpress/gutenberg or adding your support to an existing issue if one exists
    – Tom J Nowell
    Dec 1, 2023 at 16:01

1 Answer 1

0

If you're talking about nested Gutenberg blocks, you only need to add the InnerBlocks component.

I think this is what you're looking for :

https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/

Here you have all the code you need and most of the use cases.

Hope it helps !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.