Start overridding footer widgets
This commit is contained in:
parent
585d907279
commit
dd7b79f395
2 changed files with 38 additions and 0 deletions
wp-content/themes/twentynineteen-tailwindcss
|
@ -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');
|
||||
|
|
|
@ -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; ?>
|
Loading…
Add table
Add a link
Reference in a new issue