Wider Content Area in the Editor
Makes the writing area of the block editor wider, giving more room on large screens without changing how the site looks to visitors.
Opens WPIDE on
Code
// Width of the content column in the editor.
$wpide_editor_content_width = '1000px';
add_action( 'enqueue_block_assets', function () use ( $wpide_editor_content_width ) {
if ( ! is_admin() || ! preg_match( '/^\d+(\.\d+)?(px|rem|em|vw|%)$/', $wpide_editor_content_width ) ) {
return;
}
wp_register_style( 'wpide-editor-width', false, array(), '1.0' );
wp_enqueue_style( 'wpide-editor-width' );
wp_add_inline_style( 'wpide-editor-width', '.editor-styles-wrapper{--wp--style--global--content-size:' . $wpide_editor_content_width . ';}.editor-styles-wrapper .is-root-container > .wp-block:not([data-align="wide"]):not([data-align="full"]){max-width:' . $wpide_editor_content_width . ';}' );
} );
Notes
Set any CSS width such as 1000px or 75rem.
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.