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?
- Multiple Inputs in a Customizer Control
- Embedding a SOAP Client into a WordPress Plugin?
- Remove WordPress theme from a specific page
- How to keep a WordPress site synchronized between two servers?
- difference between esc_attr(), strip_slashes(), strip_tags()?
- Rearrange elements outputted by comment_form()
- How to build custom WP admin with custom URLs
- Custom editor field displaying HTML in Visual editor
- generate unique number when registering a user
- Looking to display non-image files in Gallery with logo specific to file type
- How to set default values for options page
- Is it ok to not a have child theme and just create a theme from scratch?
- Force pdf download not working when include blog-header.php
- Passing page url into a custom field via the Press-This bookmarklet
- Using transients to store captchas
- How to extend nav-menu-item-control data in Appearance > Customize?
- Recommend an open source, template driven website builder UI that produces a working WordPress site [closed]
- How to pass external variables to the wp_new_user_notification_email filter?
- Video to stretch across the entire homepage [closed]
- How can I allow access to multiple users, using the same login, at the same time?
- Does all editing of WordPress occur within the dashboard, or can we use our own text editor?
- Is it possible to have one page with multiple items, or 2 blogs on a site?
- Function to allow “Anyone can register”?
- TwentyFifteen: How can it show a different color on every post page?
- How Can I Move Data From Form 1 To Form 2
- wp_query get post custom taxonomy in search.php
- Custom login with external provider iframe and data object
- get author in blog posts?
- Users can only view their content from the front end
- Localization: I want the backend: english and frontend in defined language
- Theme compression/ minifying or W3 Total Cache – which should I use? [closed]
- How to remove all the items under “Personal Options” on user profile page?
- Can I integrate wordpress with my current website so I can utilize the wordpress plugins?
- Widget title markup in register_sidebar
- Sticky menu for WP custom menubars
- Garbage in uploads folder
- What is theme-editor.tmp?
- More tag – how do I remove preceding ?
- Salesforce lead tracking with contact forms plugins [closed]
- Stop Expansion of Top Level Menu in the WordPress Admin Sidebar
- How can style text like this in wordpress
- Add or Create Custom Structure Tags to Permalink
- Setup database structure with books, authors, languages etc. for publishing house [closed]
- Remove welcome panel from contact form 7 page [closed]
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- WordPress custom dropdown listings
- Help customising admin bar, removing buddypress links from dropdown
- Do I need to instantiate the XMLRPC class or any class in another class to access its methods?
- WordPress in a Subdirectory
- how or where wordress collect unlogged user session
- Customizing woocommerce product page
- javascript file not working in a plugin template file
- If Term Name Exists, Append a Unique ID to Slug
- Customizer options limited to specific user roles?
- Woocommerce custom “My Account” Tab – Add Save button
- WordPress Using Zip code customer shop find without woocommerce plugin
- How can I display both LTR and RTL language texts on the same page?
- how can custom permalink structure use for specify custom post type
- Add button to My Sites dashboard page (multisite)?
- Embedded Options in a Custom Metabox
- A specific menu inside a page, load different contents without reloading it, under the same link
- How to hide or remove a custom widget area when empty
- Dockerized WordPress is having Nginx Proxy Issues
- Highlight specific user with custom field value
- custom loop issue
- How to define a static Home page
- let users add multiple divs in static page
- Bulk product editing in wordpress
- Multiple Taxonomies Using Custom SQL Query
- Logged in only custom page
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- Search results load individual post in slide out div
- Problem Locating and Changing Alt Attribute Of Link
- Show Site Name on WP login screen
- Adding css and js to a blank page created with custom template
- Applying my own css classes in wp_menus 3?
- Conditional tag
- how do i add logo in my site
- Show total sales for each products on search results page Woocommerce
- Custom Search on media files PDF images pages posts