-
Notifications
You must be signed in to change notification settings - Fork 0
/
footer.php
135 lines (108 loc) · 4.6 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
/**
* The template for displaying the footer widget areas.
*
* @package Bucket Lite
* @since Bucket Lite 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
} ?>
</div><!-- .wrapper -->
<?php
$months = bucket::wpgrade_count_posts();
$max_posts_nr = $months['max_posts_nr'];
$months = $months['months'];
if ( !empty($months) ) { ?>
<div class="site__stats">
<div class="container">
<ul class="stat-group nav nav--banner">
<?php foreach( $months as $key => $month ) { ?>
<li>
<?php if ( isset($month['url'])) { ?>
<a href="<?php echo esc_url( $month['url'] ) ;?>" class="stat">
<?php } else { ?>
<div class="stat disable">
<?php }
//$max_posts_nr might be 0 when one hasn't published in a long long time, more then a year
if ( $max_posts_nr > 0 ) {
$percent = ( $month['count'] * 100 ) / $max_posts_nr;
} else {
$percent = 0;
} ?>
<dd class="stat__value" <?php if( $percent > 0 ) echo 'style="height:' . $percent . '%;"'; ?>><?php echo esc_html( $month['count'] ); ?></dd>
<dt class="stat__title"><?php echo esc_html( $month['month'] ); ?></dt>
<?php if ( isset( $month['url'] ) ) { ?>
</a>
<?php } else { ?>
</div>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
</div>
<?php } ?>
<footer class="site__footer">
<h2 class="accessibility"><?php esc_html__('Footer', 'bucket-lite') ?></h2>
<?php
/* The footer widget area is triggered if any of the areas
* have widgets. So let's check that first.
*
* If none of the sidebars have widgets, then let's bail early.
*/
if (is_active_sidebar('sidebar-footer-first-1')
|| is_active_sidebar('sidebar-footer-first-2')
|| is_active_sidebar('sidebar-footer-first-3')
|| is_active_sidebar('sidebar-footer-second-1')
|| is_active_sidebar('sidebar-footer-second-2')
){
// If we get this far, we have widgets. Let do this.
?>
<div class="footer__sidebar">
<div class="container">
<div class="footer__widget-area grid"><!--
<?php if ( is_active_sidebar( 'sidebar-footer-first-1' ) ) { ?>
--><div class="grid__item one-third palm-one-whole">
<?php dynamic_sidebar( 'sidebar-footer-first-1' ); ?>
</div><!--
<?php }?>
<?php if ( is_active_sidebar( 'sidebar-footer-first-2' ) ) { ?>
--><div class="grid__item one-third palm-one-whole">
<?php dynamic_sidebar( 'sidebar-footer-first-2' ); ?>
</div><!--
<?php } ?>
<?php if ( is_active_sidebar( 'sidebar-footer-first-3' ) ) { ?>
--><div class="grid__item one-third palm-one-whole">
<?php dynamic_sidebar( 'sidebar-footer-first-3' ); ?>
</div><!--
<?php } ?>
--></div>
<div class="footer__widget-area grid"><!--
<?php if ( is_active_sidebar( 'sidebar-footer-second-1' ) ) { ?>
--><div class="grid__item two-thirds palm-one-whole">
<?php dynamic_sidebar( 'sidebar-footer-second-1' ); ?>
</div><!--
<?php } ?>
<?php if ( is_active_sidebar( 'sidebar-footer-second-2' ) ) { ?>
--><div class="grid__item one-third palm-one-whole">
<?php dynamic_sidebar( 'sidebar-footer-second-2' ); ?>
</div><!--
<?php } ?>
--></div>
</div>
</div>
<?php } ?>
<div class="footer__copyright">
<div class="container">
<div class="flexbox">
<div class="footer-copyright flexbox__item"><?php bucket_lite_footer_the_copyright();?></div>
<div class="footer-menu flexbox__item "><?php wpgrade_footer_nav() ?></div>
</div>
</div>
</div>
</footer><!-- .site__footer -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>