Skip to content

Instantly share code, notes, and snippets.

@johnregan3
Last active April 16, 2019 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnregan3/ae04d69f9046c316480ce0afa22dfb4d to your computer and use it in GitHub Desktop.
Save johnregan3/ae04d69f9046c316480ce0afa22dfb4d to your computer and use it in GitHub Desktop.
Gutenberg Custom Editor Styles - PHP
<?php
/**
* Enqueue the Gutenberg editor stylesheet.
*
* Put this in your functions.php.
*
* @action enqueue_block_editor_assets
*/
function jr3_enqueue_gutenberg() {
// Make sure you link this to your actual file.
wp_register_style( 'jr3-gutenberg', get_stylesheet_directory_uri() . '/css/editor.css' );
wp_enqueue_style( 'jr3-gutenberg' );
// This font is enqueued for the demo only. You probably won't need this.
wp_register_style( 'jr3-webfonts', 'https://fonts.googleapis.com/css?family=Montserrat' );
wp_enqueue_style( 'jr3-webfonts' );
}
add_action( 'enqueue_block_editor_assets', 'jr3_enqueue_gutenberg' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment