-
Notifications
You must be signed in to change notification settings - Fork 1
/
sidebar-footer.php
executable file
·58 lines (55 loc) · 1.4 KB
/
sidebar-footer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* The Footer widget areas.
*
* @since 0.0.1
*/
essence_show_template_file( __FILE__ );
$essence_footer_sidebars = array(
'first-footer-widget-area',
'second-footer-widget-area',
'third-footer-widget-area',
'fourth-footer-widget-area',
);
foreach ( $essence_footer_sidebars as $index => $sidebar ) {
if ( ! is_active_sidebar( $sidebar ) )
unset( $essence_footer_sidebars[$index] );
}
/**
* The footer widget area is triggered if any of the areas have widgets. If
* none do, return
*/
if ( empty( $essence_footer_sidebars ) )
return;
switch ( 12 / count( $essence_footer_sidebars ) ) {
case 3:
$essence_footer_sidebar_columns = 'three';
break;
case 4:
$essence_footer_sidebar_columns = 'four';
break;
case 6:
$essence_footer_sidebar_columns = 'six';
break;
case 12:
$essence_footer_sidebar_columns = 'twelve';
break;
}
?>
<div class="row footer" role="contentinfo">
<div id="footer-widget-area" role="complementary">
<?php
foreach ( $essence_footer_sidebars as $sidebar ) {
if ( is_active_sidebar( 'first-footer-widget-area' ) ) {
?>
<div class="widget-area columns <?php echo esc_attr( $essence_footer_sidebar_columns ) ?>">
<ul class="xoxo">
<?php dynamic_sidebar( $sidebar ); ?>
</ul>
</div><!-- .widget-area -->
<?php
}
}
?>
</div><!-- #footer-widget-area -->
</div><!-- .row.footer -->