Start overridding footer widgets

This commit is contained in:
Oliver Davies 2019-03-27 18:21:37 +00:00
parent 585d907279
commit dd7b79f395
2 changed files with 38 additions and 0 deletions
wp-content/themes/twentynineteen-tailwindcss
functions.php
template-parts/footer

View file

@ -1,3 +1,17 @@
<?php
wp_enqueue_style( 'style', get_stylesheet_uri() );
function tw_widgets() {
register_sidebar(
array(
'name' => 'Sidebar',
'id' => 'tw-sidebar',
'before_title' => '<h2 class="text-4xl font-bold text-gray-800">',
'after_title' => '</h2>',
'before_widget' => '<div class="mt-16 w-1/2 px-6">',
'after_widget' => '</div>',
)
);
}
add_action('widgets_init', 'tw_widgets');

View file

@ -0,0 +1,24 @@
<?php
/**
* Displays the footer widget area
*
* @package WordPress
* @subpackage Twenty_Nineteen
* @since 1.0.0
*/
if ( is_active_sidebar( 'tw-sidebar' ) ) : ?>
<aside class="widget-area" role="complementary" aria-label="<?php esc_attr_e( 'Footer', 'twentynineteen' ); ?>">
<?php
if (is_active_sidebar('tw-sidebar')) {
?>
<div class="flex flex-wrap -mx-6">
<?php dynamic_sidebar('tw-sidebar'); ?>
</div>
<?php
}
?>
</aside><!-- .widget-area -->
<?php endif; ?>