Permalink
Browse files

Add basic support for Gutenberg theme features.

  • Loading branch information...
BinaryMoon committed Dec 25, 2017
1 parent 504a75b commit 777cd2903c1e4a8ebfc6060e86a7f7a4ef2387da
Showing with 63 additions and 1 deletion.
  1. +5 −1 functions.php
  2. +58 −0 inc/gutenberg.php
View
@@ -72,10 +72,14 @@
require 'inc/jetpack.php';
}
// Support for the Gutenberg content editor.
require 'inc/gutenberg.php';
// Custom Custmomizer control that adds a category dropdown select box.
require 'inc/class-granule-category-dropdown-custom-control.php';
// Custom Custmomizer control that adds a drag and drop system for rearranging content.
// Custom Custmomizer control that adds a drag and drop system for rearranging
// content.
require 'inc/class-granule-dragdrop-list-control.php';
// Custom Custmomizer control that adds a custom dropdown select box.
View
@@ -0,0 +1,58 @@
<?php
/**
* Gutenberg Compatibility File
*
* @package Granule
* @subpackage Gutenberg
* @author Ben Gillbanks <ben@prothemedesign.com>
* @link https://github.com/WordPress/gutenberg/
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
*/
/**
* Add theme support for Gutenberg.
*/
function granule_gutenberg_init() {
/**
* Add theme support for Gutenberg functionality.
*
* @link https://wordpress.org/gutenberg/handbook/reference/theme-support/
*/
add_theme_support(
'gutenberg',
array(
// Full width images and other content such as videos.
// Remove this if the theme does not support a
// full width layout.
'wide-images' => true,
// Custom colours for use in the editor. A nice way to provide
// consistancy in user editable content.
'colors' => array(
'#ffffff',
'#ffffff',
'#ffffff',
'#ffffff',
'#ffffff',
'#ffffff',
),
)
);
}
add_action( 'after_setup_theme', 'granule_gutenberg_init' );
/**
* Enqueue WordPress theme styles within the Gutenberg editor.
*/
function granule_gutenberg_styles() {
// Load the theme styles within Gutenberg.
// wp_enqueue_style( 'granule-gutenberg', get_theme_file_uri( '/assets/css/gutenberg.css' ), false, '1.0', 'all' );
}
add_action( 'enqueue_block_editor_assets', 'granule_gutenberg_styles' );

0 comments on commit 777cd29

Please sign in to comment.