Skip to content

Commit

Permalink
Create parts directory and enable theme support for Block Template Pa…
Browse files Browse the repository at this point in the history
…rts (#61)

Also removed footer widgets, I think we are beyond widgets now.
  • Loading branch information
cr0ybot authored Feb 22, 2023
2 parents 90953b3 + dfae1bc commit 101e42d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
23 changes: 3 additions & 20 deletions inc/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', __NAMESPACE__ . '\\widget_areas' );

/**
* Register scripts and styles.
*
Expand Down
Empty file added parts/footer.html
Empty file.
2 changes: 1 addition & 1 deletion template-parts/site/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</nav>

<div class="site-footer__widgets">
<?php get_sidebar( 'footer' ); ?>
<?php block_template_part( 'footer' ); ?>
</div>
</div>
</footer><!-- .site-footer -->

0 comments on commit 101e42d

Please sign in to comment.