Turn On Modern Block Features in Classic Themes
Enables wide and full alignments, responsive embeds, spacing, border, line height and link color controls for classic themes that never declared them.
Opens WPIDE on
Code
add_action( 'after_setup_theme', function () {
if ( wp_is_block_theme() ) {
return;
}
foreach ( array( 'align-wide', 'responsive-embeds', 'custom-spacing', 'custom-line-height', 'custom-units', 'link-color', 'border', 'appearance-tools' ) as $feature ) {
add_theme_support( $feature );
}
}, 20 );
Notes
Your theme's CSS decides how wide alignments look; test a few pages after enabling it.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.