I’m sure there are other ways e.g. with CSS only or Add custom class to core blocks in Gutenberg, but regarding:
Add a containing DIV to core Gutenberg blocks
one way could be with the render_block filter:
add_filter( 'render_block', function( $block_content, $block ) {
// Target core/* and core-embed/* blocks.
if ( preg_match( '~^core/|core-embed/~', $block['blockName'] ) ) {
$block_content = sprintf( '<div class="some__class">%s</div>', $block_content );
}
return $block_content;
}, PHP_INT_MAX - 1, 2 );
to div-wrap the core blocks on the frontend.
Changing the HTML layout might affect the current style of the site.
Related Posts:
- Running Gutenberg React in Development Mode
- How to make a script load after Custom Block is loaded in the editor?
- Is it possible to use Gutenberg on the front-end?
- When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
- Gutenberg Blocks – Attributes from comment delimiter or from HTML?
- Gutenberg: How to mix dynamic and static output?
- What values can we use in `formattingControls` parameter in RichText component
- How to use
- How to get custom page template being edited in gutenberg editor
- Gutenberg block outputting JSON in front end – is this normal?
- How can I use a Tiny MCE editor in my custom Gutenberg block?
- How can I have a common background color across multiple WordPress blocks?
- Created Custom Block – When I come back to edit post/page and change my block content – Update button stays disabled
- Custom default settings for WP native Gallery Block
- Will WordPress updates remove Gutenberg Additional Classes?
- adding fade on mouseover to images
- Is it possible to edit a wordpress category with Gutenberg?
- wp.blocks.registerBlockType not showing what I want on the frontend
- How do I add custom CSS animations for specific Gutenberg blocks?
- Multi color post title by using custom javascript inside the gutenberg editor?
- Customise “Add a New Post” page
- How to use standalone Gutenberg (block editor) instance on any my own admin page in WordPress
- How do i get custom fontSizes and theme fontSizes?
- What Is The Use Of map_meta_cap Filter?
- How to *remove* a parent theme page template from a child theme?
- How to use PanelColorSettings in custom Gutenberg block?
- How to disable page delete
- How to update the delete user confirmation form?
- Need logged in users returing to site redirected to a separate page
- Widgets vs. Theme Mods
- In the new Theme Customizer API, how to send a value from the front back to the admin panel?
- Adding an email column to a Custom Post Types Admin Screen?
- Print shortcode in custom action hook not where the shortcode is entered
- simple expandable vertical menu, java script problem
- Custom search page and search by title, content and tag
- sanitize attachment filename
- register_sidebar ‘after_widget’ on custom-built widgets not implementing, caused nested widgets
- Rebuild vs Upgrade – need pointers, advice
- Can I develop a WordPress site without a domain?
- How to extend customize control types to list pages
- Customize the WordPress Default Gallery Output
- Send a custom WooCommerce email when custom order change [closed]
- How to get rid of from overbooking car rental website [closed]
- Advanced Custom Fields: Sorting custom columns with custom fields sorts only by date
- Programmatically (PHP) get the nr. of items in the primary navigation menu
- Custom static page get_header error
- Multi Site installation inside a sub domain inside a sub directory
- How to create left and right menu with logo center in a custom theme?
- Custom post type adds time/date and author to the post?
- 1 WordPress installation with 2 pages: every page gets a separate domain
- Changing settings of WooCommerce
- How can I stop access of unregistered user in wp-content/uploads directory without using .htaccess file?
- Page content dissapears after loading the page [closed]
- wp_customize set_transient except during preview
- How do you add a table to a site?
- how to make a custom field readonly or disabled by user role?
- How to make wordpress use a non-wordpress users table?
- WooCommerce custom billing fields on email address
- Is there a straight-forward way to provide a meta description tag via Yoast SEO, programmatically, without relying on the admin panel?
- Allow multisite admins only to create users with one specific user role?
- Restrict content access to logged in users
- Make tag archive display post are ordered by post format
- Custom Form not generating URL
- How to move meta information in TwentyTwelve’s single post template?
- How to Clear Empty Search values?
- WordPress Command Question
- getting a 404 page for all pages except home. possibly permalinks
- How do I create a Custom Post Box that Connects Different Posts Together
- Pull Latest Forum Posts within WordPress
- saving the widgets position after drag and drop
- Google calendar in wordpress showing events
- Custom menu not showing even though it shows as being registered?
- Open login logo URL in new tab
- Multisite with subdirectories, and a WordPress installation in a custom folder
- Display all subterms of a custom taxonomy filtered by parent terms
- Delete a column in edit.php generated with a plugin
- Migrating my site to a new domain does not keep any changes made in customizer
- how to add custom html and css to wordpress
- How to use the same custom page template to iframe multiple urls with entry of new url entered from backend
- Unhook a function within a class in the child theme
- Where to put coding a validation script for store? [duplicate]
- User WordPress menu in custom page
- How to define active widget with js in a customizer
- where can i find the login page in wordpress and add my header to it
- Class .current-menu-item in custom menu Walker
- Add several fields from different tables to post, fields per post are in same row of table
- What shortcode should I use for
- Custom folder structure and problem with 3rd party services
- How to strip thumb from widget
- Issue with WordPress native theme customizer function and jquery ui tabs
- add custom css on all page exept of one
- Custom Search Results Page
- Typing and seeing math equations on WordPress site
- Admin new order email customization
- How to add custom page using them in wordpress 3.5
- woocommerce display product category on checkout page [closed]
- Notify/check if the content of a custom gutenberg block has changed on save_post
- Best approach to change mobile background image and adding its class
- Add line break for menu items
- Add a custom field for sorting the products in a specific category WOOCOMMERCE