Skip to content

Instantly share code, notes, and snippets.

@notasausage
Last active February 6, 2019 21:15
Show Gist options
  • Save notasausage/30ae8ad2ba0336f98e0d1fb2e159430c to your computer and use it in GitHub Desktop.
Save notasausage/30ae8ad2ba0336f98e0d1fb2e159430c to your computer and use it in GitHub Desktop.
WordPress plugin to force the Gutenberg block editor to be wider (full width).
<?php
/**
* Plugin Name: Block Editor Full Width
* Description: Fix the Gutenberg block editor width to the full window (with a max-width)
* Author: Patrick Haney
* Author URI: http://patrickhaney.com
* Version: 1.0.0
* Text Domain: block_editor_full_width
* License: GPL2+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*
* @package Block Editor Full Width
*/
function block_editor_full_width() {
echo '<style>
.wp-block {
width: 100% !important;
max-width: none !important;
}
.editor-styles-wrapper .editor-writing-flow {
/* Set this max-width to whatever you like */
max-width: 1440px !important;
margin: 0 auto !important;
}
</style>';
}
add_action( 'admin_head', 'block_editor_full_width' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment