-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebar-footer.php
executable file
·61 lines (53 loc) · 2.03 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
59
60
61
<?php
/**
* The sidebar containing the footer widget area.
*
* @package Stuff
*/
/**
* The sidebars
*/
$mysidebars = array(
'footer-sidebar-1',
'footer-sidebar-2',
'footer-sidebar-3',
'footer-sidebar-4',
);
$sidebars = array();
foreach ( $mysidebars as $column ) {
if ( is_active_sidebar( $column ) ) {
$sidebars[] = $column;
}
};
$footer_layout = get_theme_mod( 'stuff_footer_columns', false );
if ( ! $footer_layout ) {
$footer_layout = Stuff_Helper::get_footer_default();
}
if ( ! is_array( $footer_layout ) ) {
$footer_layout = json_decode( $footer_layout, true );
}
?>
<footer id="colorlib-footer" role="contentinfo">
<div class="container">
<?php if ( ! empty( $sidebars ) ) { ?>
<div class="row row-pb-md">
<?php foreach ( $footer_layout['columns'] as $sidebar ) : ?>
<?php if ( is_active_sidebar( 'footer-sidebar-' . $sidebar['index'] ) ) { ?>
<div id="footer-widget-area-<?php echo esc_attr( $sidebar['index'] ); ?>" class="col-sm-<?php echo esc_attr( $sidebar['span'] ); ?>">
<?php dynamic_sidebar( 'footer-sidebar-' . $sidebar['index'] ); ?>
</div>
<?php } ?>
<?php endforeach; ?>
</div>
<?php } ?>
<?php if( get_theme_mod('stuff_copyright_contents', true ) ){ ?>
<div class="row">
<div class="col-md-12">
<p>
<?php echo wp_kses_post( get_theme_mod('stuff_copyright_contents', '<small class="block">Copyright ©2018 All rights reserved | This template is made with <i class="icon-heart" aria-hidden="true"></i> by <a href="'.esc_url( 'https://colorlib.com' ).'" target="_blank">Colorlib</a></small> <small class="block">Demo Images: <a href="http://unsplash.co/" target="_blank">Unsplash</a></small>' )); ?>
</p>
</div>
</div>
<?php } ?>
</div>
</footer>