diff --git a/penscratch-2/css/editor-blocks.css b/penscratch-2/css/editor-blocks.css
index d656e0b5fc..391b859df1 100644
--- a/penscratch-2/css/editor-blocks.css
+++ b/penscratch-2/css/editor-blocks.css
@@ -19,6 +19,10 @@ Description: Used to style Gutenberg Blocks in the editor.
1.0 General Typography
--------------------------------------------------------------*/
+body {
+ background: #fff;
+}
+
.block-editor-block-list__block,
.editor-default-block-appender textarea.editor-default-block-appender__content {
font-family: "Roboto Slab", Georgia, Times, serif;
diff --git a/penscratch-2/functions.php b/penscratch-2/functions.php
index b8ac91ecd2..342243e1c3 100644
--- a/penscratch-2/functions.php
+++ b/penscratch-2/functions.php
@@ -6,113 +6,136 @@
*/
if ( ! function_exists( 'penscratch_2_setup' ) ) :
-/**
- * Sets up theme defaults and registers support for various WordPress features.
- *
- * Note that this function is hooked into the after_setup_theme hook, which
- * runs before the init hook. The init hook is too late for some features, such
- * as indicating support for post thumbnails.
- */
-function penscratch_2_setup() {
-
- /*
- * Make theme available for translation.
- * Translations can be filed in the /languages/ directory.
- * If you're building a theme based on Penscratch 2, use a find and replace
- * to change 'penscratch-2' to the name of your theme in all the template files
+ /**
+ * Sets up theme defaults and registers support for various WordPress features.
+ *
+ * Note that this function is hooked into the after_setup_theme hook, which
+ * runs before the init hook. The init hook is too late for some features, such
+ * as indicating support for post thumbnails.
*/
- load_theme_textdomain( 'penscratch-2', get_template_directory() . '/languages' );
+ function penscratch_2_setup() {
+
+ /*
+ * Make theme available for translation.
+ * Translations can be filed in the /languages/ directory.
+ * If you're building a theme based on Penscratch 2, use a find and replace
+ * to change 'penscratch-2' to the name of your theme in all the template files
+ */
+ load_theme_textdomain( 'penscratch-2', get_template_directory() . '/languages' );
+
+ // Add default posts and comments RSS feed links to head.
+ add_theme_support( 'automatic-feed-links' );
+
+ /*
+ * Let WordPress manage the document title.
+ * By adding theme support, we declare that this theme does not use a
+ * hard-coded
tag in the document head, and expect WordPress to
+ * provide it for us.
+ */
+ add_theme_support( 'title-tag' );
+
+ /*
+ * Enable support for Post Thumbnails on posts and pages.
+ *
+ * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
+ */
+ add_theme_support( 'post-thumbnails' );
+ add_image_size( 'penscratch-2-featured', '656', '300', true );
+
+ // This theme uses wp_nav_menu() in one location.
+ register_nav_menus(
+ array(
+ 'menu-1' => esc_html__( 'Header', 'penscratch-2' ),
+ )
+ );
- // Add default posts and comments RSS feed links to head.
- add_theme_support( 'automatic-feed-links' );
+ /*
+ * Switch default core markup for search form, comment form, and comments
+ * to output valid HTML5.
+ */
+ add_theme_support(
+ 'html5',
+ array(
+ 'search-form',
+ 'comment-form',
+ 'comment-list',
+ 'gallery',
+ 'caption',
+ )
+ );
- /*
- * Let WordPress manage the document title.
- * By adding theme support, we declare that this theme does not use a
- * hard-coded tag in the document head, and expect WordPress to
- * provide it for us.
- */
- add_theme_support( 'title-tag' );
+ // Enable support for custom logo.
+ add_theme_support(
+ 'custom-logo',
+ array(
+ 'height' => 400,
+ 'width' => 1200,
+ 'flex-height' => true,
+ 'flex-width' => true,
+ )
+ );
- /*
- * Enable support for Post Thumbnails on posts and pages.
- *
- * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
- */
- add_theme_support( 'post-thumbnails' );
- add_image_size( 'penscratch-2-featured', '656', '300', true );
+ // Add theme support for selective refresh for widgets.
+ add_theme_support( 'customize-selective-refresh-widgets' );
+
+ // Setup the WordPress core custom background feature.
+ add_theme_support(
+ 'custom-background',
+ apply_filters(
+ 'penscratch_2_custom_background_args',
+ array(
+ 'default-color' => 'eeeeee',
+ 'default-image' => '',
+ )
+ )
+ );
- // This theme uses wp_nav_menu() in one location.
- register_nav_menus( array(
- 'menu-1' => esc_html__( 'Header', 'penscratch-2' ),
- ) );
+ // Add support for responsive embeds.
+ add_theme_support( 'responsive-embeds' );
- /*
- * Switch default core markup for search form, comment form, and comments
- * to output valid HTML5.
- */
- add_theme_support( 'html5', array(
- 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
- ) );
-
- // Enable support for custom logo.
- add_theme_support( 'custom-logo', array(
- 'height' => 400,
- 'width' => 1200,
- 'flex-height' => true,
- 'flex-width' => true
- ) );
-
- // Add theme support for selective refresh for widgets.
- add_theme_support( 'customize-selective-refresh-widgets' );
-
- // Setup the WordPress core custom background feature.
- add_theme_support( 'custom-background', apply_filters( 'penscratch_2_custom_background_args', array(
- 'default-color' => 'eeeeee',
- 'default-image' => '',
- ) ) );
-
- // Add support for responsive embeds.
- add_theme_support( 'responsive-embeds' );
-
- // Add custom colors to Gutenberg
- add_theme_support(
- 'editor-color-palette', array(
- array(
- 'name' => esc_html__( 'Dark Green', 'penscratch-2' ),
- 'slug' => 'dark-green',
- 'color' => '#1c7c7c',
- ),
- array(
- 'name' => esc_html__( 'Dark Gray', 'penscratch-2' ),
- 'slug' => 'dark-gray',
- 'color' => '#666',
- ),
+ // Add custom colors to Gutenberg
+ add_theme_support(
+ 'editor-color-palette',
array(
- 'name' => esc_html__( 'Medium Gray', 'penscratch-2' ),
- 'slug' => 'medium-gray',
- 'color' => '#999',
- ),
- array(
- 'name' => esc_html__( 'Light Gray', 'penscratch-2' ),
- 'slug' => 'light-gray',
- 'color' => '#eee',
- ),
- array(
- 'name' => esc_html__( 'White', 'penscratch-2' ),
- 'slug' => 'white',
- 'color' => '#fff',
- ),
- )
- );
+ array(
+ 'name' => esc_html__( 'Dark Green', 'penscratch-2' ),
+ 'slug' => 'dark-green',
+ 'color' => '#1c7c7c',
+ ),
+ array(
+ 'name' => esc_html__( 'Dark Gray', 'penscratch-2' ),
+ 'slug' => 'dark-gray',
+ 'color' => '#666',
+ ),
+ array(
+ 'name' => esc_html__( 'Medium Gray', 'penscratch-2' ),
+ 'slug' => 'medium-gray',
+ 'color' => '#999',
+ ),
+ array(
+ 'name' => esc_html__( 'Light Gray', 'penscratch-2' ),
+ 'slug' => 'light-gray',
+ 'color' => '#eee',
+ ),
+ array(
+ 'name' => esc_html__( 'White', 'penscratch-2' ),
+ 'slug' => 'white',
+ 'color' => '#fff',
+ ),
+ )
+ );
- add_theme_support( 'editor-styles' );
- add_editor_style( array(
- get_theme_file_uri( '/css/editor-blocks.css' ),
- penscratch_2_fonts_url()
- ) );
+ add_theme_support( 'editor-styles' );
+ add_editor_style(
+ array(
+ 'style.css',
+ '/css/blocks.css',
+ '/css/editor-blocks.css',
+ penscratch_2_fonts_url(),
+ )
+ );
-}
+ }
endif; // penscratch_2_setup
add_action( 'after_setup_theme', 'penscratch_2_setup' );
@@ -143,38 +166,46 @@ function penscratch_2_adjust_content_width() {
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function penscratch_2_widgets_init() {
- register_sidebar( array(
- 'name' => esc_html__( 'Sidebar', 'penscratch-2' ),
- 'id' => 'sidebar-1',
- 'before_widget' => '',
- 'before_title' => '',
- ) );
- register_sidebar( array(
- 'name' => esc_html__( 'Footer 1', 'penscratch-2' ),
- 'id' => 'sidebar-2',
- 'before_widget' => '',
- 'before_title' => '',
- ) );
- register_sidebar( array(
- 'name' => esc_html__( 'Footer 2', 'penscratch-2' ),
- 'id' => 'sidebar-3',
- 'before_widget' => '',
- 'before_title' => '',
- ) );
- register_sidebar( array(
- 'name' => esc_html__( 'Footer 3', 'penscratch-2' ),
- 'id' => 'sidebar-4',
- 'before_widget' => '',
- 'before_title' => '',
- ) );
+ register_sidebar(
+ array(
+ 'name' => esc_html__( 'Sidebar', 'penscratch-2' ),
+ 'id' => 'sidebar-1',
+ 'before_widget' => '',
+ 'before_title' => '',
+ )
+ );
+ register_sidebar(
+ array(
+ 'name' => esc_html__( 'Footer 1', 'penscratch-2' ),
+ 'id' => 'sidebar-2',
+ 'before_widget' => '',
+ 'before_title' => '',
+ )
+ );
+ register_sidebar(
+ array(
+ 'name' => esc_html__( 'Footer 2', 'penscratch-2' ),
+ 'id' => 'sidebar-3',
+ 'before_widget' => '',
+ 'before_title' => '',
+ )
+ );
+ register_sidebar(
+ array(
+ 'name' => esc_html__( 'Footer 3', 'penscratch-2' ),
+ 'id' => 'sidebar-4',
+ 'before_widget' => '',
+ 'before_title' => '',
+ )
+ );
}
add_action( 'widgets_init', 'penscratch_2_widgets_init' );
@@ -204,7 +235,7 @@ function penscratch_2_scripts() {
* Register Google Fonts
*/
function penscratch_2_fonts_url() {
- $fonts_url = '';
+ $fonts_url = '';
/* Translators: If there are characters in your language that are not
* supported by Roboto Slab, translate this to 'off'. Do not translate
@@ -212,9 +243,9 @@ function penscratch_2_fonts_url() {
*/
$robotoslab = esc_html_x( 'on', 'Roboto Slab font: on or off', 'penscratch-2' );
- if ( 'off' !== $robotoslab ) {
+ if ( 'off' !== $robotoslab ) {
- $font_families = array();
+ $font_families = array();
$font_families[] = 'Roboto Slab:300,400,700';
$query_args = array(