From 91cdf824f229c13bd5b7b76efb961c420bb66a1f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 16 Apr 2019 20:25:28 +0100 Subject: [PATCH] Rename sidebar to sidebar-1 Matches the parent theme, so widgets should be pre-placed. --- .../themes/twentynineteen-tailwindcss/functions.php | 12 +++++++++--- .../template-parts/footer/footer-widgets.php | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/wp-content/themes/twentynineteen-tailwindcss/functions.php b/wp-content/themes/twentynineteen-tailwindcss/functions.php index 03f669a..3554410 100644 --- a/wp-content/themes/twentynineteen-tailwindcss/functions.php +++ b/wp-content/themes/twentynineteen-tailwindcss/functions.php @@ -2,15 +2,21 @@ wp_enqueue_style( 'style', get_stylesheet_uri() ); +// override the widget styles for sidebar-1 +add_action('after_setup_theme', function () { + remove_action( 'widgets_init', 'twentynineteen_widgets_init' ); +}); + add_action('widgets_init', function () { register_sidebar( array( 'name' => 'Sidebar', - 'id' => 'tw-sidebar', - 'before_title' => '

', + 'id' => 'sidebar-1', + 'before_title' => '

', 'after_title' => '

', - 'before_widget' => '
', + 'before_widget' => '
', 'after_widget' => '
', ) ); }); + diff --git a/wp-content/themes/twentynineteen-tailwindcss/template-parts/footer/footer-widgets.php b/wp-content/themes/twentynineteen-tailwindcss/template-parts/footer/footer-widgets.php index 67a53d1..8f5e1be 100644 --- a/wp-content/themes/twentynineteen-tailwindcss/template-parts/footer/footer-widgets.php +++ b/wp-content/themes/twentynineteen-tailwindcss/template-parts/footer/footer-widgets.php @@ -7,14 +7,14 @@ * @since 1.0.0 */ -if ( is_active_sidebar( 'tw-sidebar' ) ) : ?> +if ( is_active_sidebar( 'sidebar-1' ) ) : ?>