-
Notifications
You must be signed in to change notification settings - Fork 1
/
sidebar-footer.php
executable file
·48 lines (41 loc) · 1.14 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
<?php
/**
* The sidebar containing the main widget area
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @since sierra 1.0
*/
$sierra_sidebar = array(
'footer-sidebar-1',
'footer-sidebar-2',
'footer-sidebar-3',
'footer-sidebar-4',
);
$sidebars = array();
foreach ( $sierra_sidebar as $column ){
if( is_active_sidebar( $column ) ) {
$sidebars[] = $column;
}
}
$footer_layout = get_theme_mod( 'sierra_footer_columns', false );
if( ! $footer_layout ){
$footer_layout = Sierra_Helper::get_footer_default();
}
if ( ! is_array( $footer_layout ) ) {
$footer_layout = json_decode( $footer_layout, true );
}
?>
<?php
if( ! empty( $sidebars ) ) {
foreach ( $footer_layout['columns'] as $sidebar ) {
if ( is_active_sidebar( 'footer-sidebar-' . $sidebar['index'] ) ) {
?>
<div id="footer-widget-<?php echo esc_attr( $sidebar['span'] ); ?>" class="col-md-<?php echo esc_attr( $sidebar['span'] ); ?> colorlib-widget">
<?php dynamic_sidebar( 'footer-sidebar-' . $sidebar['index'] ); ?>
</div>
<?php
}
}
}
?>