From dfae1bcce51c8fb0faee3285e0fcd0f65e67e1cf Mon Sep 17 00:00:00 2001 From: Phil Hoyt Date: Thu, 16 Feb 2023 14:25:24 -0500 Subject: [PATCH] Create parts directory and enable theme support for Block Template Parts Also removed footer widgets, I think we are beyond widgets now. --- inc/setup.php | 23 +++-------------------- parts/footer.html | 0 template-parts/site/footer.php | 2 +- 3 files changed, 4 insertions(+), 21 deletions(-) create mode 100644 parts/footer.html diff --git a/inc/setup.php b/inc/setup.php index 2ebc84d..b74b15b 100644 --- a/inc/setup.php +++ b/inc/setup.php @@ -91,6 +91,9 @@ function setup() { add_theme_support( 'editor-styles' ); add_editor_style( 'dist/css/editor.css' ); + // Add support for Block Template Part. + add_theme_support( 'block-template-parts' ); + /** * Remove theme support declarations. */ @@ -120,26 +123,6 @@ function menus() { } add_action( 'init', __NAMESPACE__ . '\\menus' ); -/** - * Register widget areas. - * - * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar - */ -function widget_areas() { - register_sidebar( - array( - 'name' => esc_html__( 'Footer', 'themescaffold' ), - 'id' => 'footer', - 'description' => esc_html__( 'Footer blocks.', 'themescaffold' ), - 'before_widget' => '', - 'after_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) - ); -} -add_action( 'widgets_init', __NAMESPACE__ . '\\widget_areas' ); - /** * Register scripts and styles. * diff --git a/parts/footer.html b/parts/footer.html new file mode 100644 index 0000000..e69de29 diff --git a/template-parts/site/footer.php b/template-parts/site/footer.php index ff3a580..37a1565 100644 --- a/template-parts/site/footer.php +++ b/template-parts/site/footer.php @@ -15,7 +15,7 @@