forked from maddisondesigns/Quark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
footer.php
64 lines (51 loc) · 1.82 KB
/
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
62
63
64
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the id #maincontentcontainer div and all content after.
* There are also four footer widgets displayed. These will be displayed from
* one to four columns, depending on how many widgets are active.
*
* @package Quark
* @since Quark 1.0
*/
?>
<?php do_action( 'quark_after_woocommerce' ); ?>
</div> <!-- /#maincontentcontainer -->
<div id="footercontainer">
<footer class="site-footer row" role="contentinfo">
<?php
// Count how many footer sidebars are active so we can work out how many containers we need
$footerSidebars = 0;
for ( $x=1; $x<=4; $x++ ) {
if ( is_active_sidebar( 'sidebar-footer' . $x ) ) {
$footerSidebars++;
}
}
// If there's one or more one active sidebars, create a row and add them
if ( $footerSidebars > 0 ) { ?>
<?php
// Work out the container class name based on the number of active footer sidebars
$containerClass = "grid_" . 12 / $footerSidebars . "_of_12";
// Display the active footer sidebars
for ( $x=1; $x<=4; $x++ ) {
if ( is_active_sidebar( 'sidebar-footer'. $x ) ) { ?>
<div class="col <?php echo $containerClass?>">
<div class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-footer'. $x ); ?>
</div>
</div> <!-- /.col.<?php echo $containerClass?> -->
<?php }
} ?>
<?php } ?>
</footer> <!-- /.site-footer.row -->
<?php if ( of_get_option( 'footer_content', quark_get_credits() ) ) {
echo '<div class="row smallprint">';
echo apply_filters( 'meta_content', wp_kses_post( of_get_option( 'footer_content', quark_get_credits() ) ) );
echo '</div> <!-- /.smallprint -->';
} ?>
</div> <!-- /.footercontainer -->
</div> <!-- /.#wrapper.hfeed.site -->
<?php wp_footer(); ?>
</body>
</html>