页脚1和页脚2是边栏,您可以在其中添加自己的边栏functions.php
或创建子主题:
function twentyseventeen_widgets_init() {
register_sidebar( array(
\'name\' => __( \'Blog Sidebar\', \'twentyseventeen\' ),
\'id\' => \'sidebar-1\',
\'description\' => __( \'Add widgets here to appear in your sidebar on blog posts and archive pages.\', \'twentyseventeen\' ),
\'before_widget\' => \'<section id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</section>\',
\'before_title\' => \'<h2 class="widget-title">\',
\'after_title\' => \'</h2>\',
) );
register_sidebar( array(
\'name\' => __( \'Footer 1\', \'twentyseventeen\' ),
\'id\' => \'sidebar-2\',
\'description\' => __( \'Add widgets here to appear in your footer.\', \'twentyseventeen\' ),
\'before_widget\' => \'<section id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</section>\',
\'before_title\' => \'<h2 class="widget-title">\',
\'after_title\' => \'</h2>\',
) );
register_sidebar( array(
\'name\' => __( \'Footer 2\', \'twentyseventeen\' ),
\'id\' => \'sidebar-3\',
\'description\' => __( \'Add widgets here to appear in your footer.\', \'twentyseventeen\' ),
\'before_widget\' => \'<section id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</section>\',
\'before_title\' => \'<h2 class="widget-title">\',
\'after_title\' => \'</h2>\',
) );
}
add_action( \'widgets_init\', \'twentyseventeen_widgets_init\' );
您可以通过拖放小部件来添加任意数量的小部件。中显示的模板
twentyseventeen/template-parts/footer/footer-widgets.php
<?php
if ( is_active_sidebar( \'sidebar-2\' ) ||
is_active_sidebar( \'sidebar-3\' ) ) :
?>
<aside class="widget-area" role="complementary" aria-label="<?php esc_attr_e( \'Footer\', \'twentyseventeen\' ); ?>">
<?php
if ( is_active_sidebar( \'sidebar-2\' ) ) { ?>
<div class="widget-column footer-widget-1">
<?php dynamic_sidebar( \'sidebar-2\' ); ?>
</div>
<?php }
if ( is_active_sidebar( \'sidebar-3\' ) ) { ?>
<div class="widget-column footer-widget-2">
<?php dynamic_sidebar( \'sidebar-3\' ); ?>
</div>
<?php } ?>
</aside><!-- .widget-area -->
<?php endif; ?>