From 7bd5c9bc677ac2700a8c7ef1fba742ede8551686 Mon Sep 17 00:00:00 2001 From: Dac Chartrand Date: Wed, 14 Feb 2018 16:31:06 -0500 Subject: [PATCH] Misc Fixes (#91) * Suppress "Display title and tagline" in customizer (fixes #88) * Suppress header text colour in customizer (fixes #86) * Migrate site logo (fixes #85) * Change 404 message when catalog is empty (fixes #90) --- inc/activation/namespace.php | 5 +++++ inc/customizer/namespace.php | 8 ++++++++ page-catalog.php | 17 ++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/inc/activation/namespace.php b/inc/activation/namespace.php index 8bc1aaa..c99062e 100644 --- a/inc/activation/namespace.php +++ b/inc/activation/namespace.php @@ -97,6 +97,11 @@ function create_default_content() { wp_delete_post( 2, true ); wp_delete_comment( 1, true ); + // Migrate site logo + if ( ! empty( $mods['custom_logo'] ) ) { + set_theme_mod( 'custom_logo', $mods['custom_logo'] ); + } + // Add "pb_aldine_activated" option to enable check above add_option( 'pb_aldine_activated', 1 ); } diff --git a/inc/customizer/namespace.php b/inc/customizer/namespace.php index 1c79d93..0a8c33b 100644 --- a/inc/customizer/namespace.php +++ b/inc/customizer/namespace.php @@ -15,6 +15,14 @@ use PressbooksMix\Assets; * @param \WP_Customize_Manager $wp_customize Theme Customizer object. */ function customize_register( \WP_Customize_Manager $wp_customize ) { + + // Remove unsupported WP controls, @see \WP_Customize_Manager::register_controls + + $wp_customize->remove_control( 'display_header_text' ); + $wp_customize->remove_control( 'header_textcolor' ); + + // Add Pressbooks controls + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; diff --git a/page-catalog.php b/page-catalog.php index 167740e..02ce857 100644 --- a/page-catalog.php +++ b/page-catalog.php @@ -46,6 +46,21 @@ else : global $wp_query; $wp_query->set_404(); status_header( 404 ); - get_template_part( 404 ); + get_header(); + ?> +
+
+
+
+

+
+
+

+
+
+
+
+