Skip to content

Instantly share code, notes, and snippets.

@blogjunkie
Created September 14, 2020 09:20
Show Gist options
  • Save blogjunkie/1efb4c12f8d45c7d7e9537adea672cff to your computer and use it in GitHub Desktop.
Save blogjunkie/1efb4c12f8d45c7d7e9537adea672cff to your computer and use it in GitHub Desktop.
Quickly add CSS for block editor
<?php // Don't include this opening tag
/**
* Add inline styles to admin head
*/
add_action( 'admin_head', 'child_block_editor_styles' );
function child_block_editor_styles() {
if ( 'post' == get_post_type() ) :
?>
<style>
.block-editor-writing-flow .wp-block {
max-width: 800px;
}
</style>
<?php
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment