Zeak’s tutorial is different in the way that he creates three new widget areas to appear in all templates, not just the front-page template; however the general coding will be very similar.
edit sidebar-front.php in the child theme;
add another section like this to the code:
<?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
<div class="third front-widgets">
<?php dynamic_sidebar( 'sidebar-4' ); ?>
</div><!-- .third -->
<?php endif; ?>
also change the conditional code near the top;
full file: https://pastebin.com/yVZWmyfp
edit functions.php in the child theme;
add:
function twentytwelvechild_widgets_init() {
register_sidebar( array(
'name' => __( 'Third Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-4',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'twentytwelvechild_widgets_init', 15 );
for compatibility with the case that only one or two footer widgets are used, I would add this to functions.php:
add_filter( 'body_class', 'twentytwelvechild_body_class', 15 );
function twentytwelvechild_body_class( $classes ) {
if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) && is_active_sidebar( 'sidebar-4' ) ) {
$classes[] = 'three-sidebars'; //if all three footer widgets are active//
foreach($classes as $key => $value) { if ($value == 'two-sidebars') unset($classes[$key]); }
}
if ( !( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) && is_active_sidebar( 'sidebar-4' ) ) && ((is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-4' )) || (is_active_sidebar( 'sidebar-3' ) && is_active_sidebar( 'sidebar-4' ))) )
$classes[] = 'two-sidebars';
return $classes;
}
this adds the new body_class .three-sidebars
and removes the .two-sidebars
class if necessary.
some styles: https://pastebin.com/4UaXGzsu
(not too much tested)