Adding a class or weapper element to every parent contentblock

I’m trying to add default styling to content blocks so that the client doesn’t have to worry about it. Using the `render_block` filter, I managed to wrap each content block. However, I would like to place the wrapper only around content blocks at the top level, excluding those nested within another content block. Is it possible to achieve this with PHP?


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer