-
Notifications
You must be signed in to change notification settings - Fork 5
/
footer.php
260 lines (205 loc) · 8.78 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<?php
/**
* The template for displaying the Footer.
*
* @package StormBringer
* @since StormBringer 0.0.1
*/
?>
</div>
<!-- /.main-inner -->
</div>
<!-- /#main -->
</div>
<!-- /.main-wrapper -->
<nav id="navigation" role="navigation" class="navbar-stuckonscrolltop">
<?php if (is_active_sidebar('navigation-above')) : ?>
<div class="navigation-above">
<?php dynamic_sidebar('navigation-above');?>
</div>
<?php endif; ?>
<div class="navigation-inner clearfix">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navigation-collapse" aria-expanded="false" aria-controls="navigation-collapse">
<span class="sr-only"><?php _e('Toggle navigation', 'stormbringer'); ?></span>
<span class="button-label"><?php _e('Menu', 'stormbringer'); ?></span>
<div class="button-bars">
<span class="icon-bar top-bar"></span>
<span class="icon-bar middle-bar"></span>
<span class="icon-bar bottom-bar"></span>
</div>
</button>
<a class="navbar-brand" title="<?php echo esc_attr(get_bloginfo('description')); ?>" href="<?php echo home_url(); ?>">
<?php bloginfo( 'name' ); ?>
</a>
</div>
<div class="collapse navbar-collapse" id="navigation-collapse">
<?php wp_nav_menu( array(
'theme_location'=> 'main_nav',
'depth' => 2,
'container' => false,
'menu_class' => 'nav navbar-nav',
'walker' => new stormbringer_Navbar_Nav_Walker(),
'fallback_cb' => false,
) ); ?>
<?php // Theme My Login menu
if (class_exists( 'Theme_My_Login')) : $current_user=wp_get_current_user(); ?>
<ul class="nav navbar-nav navbar-right navbar-account">
<?php $args=array( 'numberposts'=> '-1', 'post_type' => 'page', 'meta_key' => '_tml_action', 'meta_value' => array( 'register', 'login', 'lostpassword', 'resetpass', 'logout', 'profile', ), ); $get_tml_actions_posts = get_posts($args); foreach ($get_tml_actions_posts as $post) { $action = get_post_meta($post->ID, '_tml_action', true); $link[$action] = get_permalink($post->ID); $title[$action] = $post->post_title; } if (0 == $current_user->ID) : // logged out ?>
<li>
<a href="<?php echo $link['login']; ?>">
<?php echo $title[ 'login']; ?>
</a>
</li>
<li>
<a href="<?php echo $link['register']; ?>">
<?php echo $title[ 'register']; ?>
</a>
</li>
<?php else : // logged in ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> <?php echo $current_user->user_login; ?>
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="<?php echo $link['profile']; ?>">
<?php echo $title[ 'profile']; ?>
</a>
</li>
<li class="divider"></li>
<li>
<a href="<?php echo $link['logout']; ?>">
<?php echo $title[ 'logout']; ?>
</a>
</li>
</ul>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
<?php // Woocommerce shopping cart
if (current_theme_supports( 'woocommerce')) : ?>
<ul class="nav navbar-nav navbar-right navbar-shoppingcart <?php echo (WC()->cart->get_cart_contents_count() == 0?'navbar-shoppingcart-empty':'navbar-shoppingcart-notempty'); ?> site-header-cart menu">
<li>
<a class="cart-contents" href="<?php echo esc_url(wc_get_cart_url()); ?>" title="<?php esc_attr_e(
'View your shopping cart', 'stormbringer'
); ?>">
<span class="amount"><?php echo wp_kses_data(WC()->cart->get_cart_subtotal()); ?></span>
<span class="count"><?php echo wp_kses_data(
sprintf(
_n('%d item', '%d items', WC()->cart->get_cart_contents_count(), 'stormbringer'),
WC()->cart->get_cart_contents_count()
)
); ?></span>
</a>
</li>
<li>
<?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
</li>
</ul>
<?php endif; ?>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.navigation-inner -->
<?php if (is_active_sidebar('navigation-below')) : ?>
<div class="navigation-below">
<?php dynamic_sidebar('navigation-below');?>
</div>
<?php endif; ?>
</nav>
<!-- #navigation -->
<?php do_action( 'stormbringer_footer_before' ); ?>
<div class="footer-above-wrapper">
<footer id="footer-above">
<div class="footer-above-inner">
<?php
if (is_active_sidebar('footer-above-4')) {
$widget_columns = apply_filters('stormbringer_footer_above_widget_regions', 4);
} elseif (is_active_sidebar('footer-above-3')) {
$widget_columns = apply_filters('stormbringer_footer_above_widget_regions', 3);
} elseif (is_active_sidebar('footer-above-2')) {
$widget_columns = apply_filters('stormbringer_footer_above_widget_regions', 2);
} elseif (is_active_sidebar('footer-above-1')) {
$widget_columns = apply_filters('stormbringer_footer_above_widget_regions', 1);
} else {
$widget_columns = apply_filters('stormbringer_footer_above_widget_regions', 0);
}
if ($widget_columns > 0) : ?>
<?php
$i = 0;
while ($i < $widget_columns) : $i++;
if (is_active_sidebar('footer-above-'.$i)) : ?>
<?php dynamic_sidebar('footer-above-'.intval($i)); ?>
<?php endif;
endwhile; ?>
<?php endif;
?>
</div>
</footer>
</div>
<!-- /.footer-above-wrapper -->
<div class="footer-wrapper">
<footer id="footer">
<div class="footer-inner">
<?php
if (is_active_sidebar('footer-4')) {
$widget_columns = apply_filters('stormbringer_footer_widget_regions', 4);
} elseif (is_active_sidebar('footer-3')) {
$widget_columns = apply_filters('stormbringer_footer_widget_regions', 3);
} elseif (is_active_sidebar('footer-2')) {
$widget_columns = apply_filters('stormbringer_footer_widget_regions', 2);
} elseif (is_active_sidebar('footer-1')) {
$widget_columns = apply_filters('stormbringer_footer_widget_regions', 1);
} else {
$widget_columns = apply_filters('stormbringer_footer_widget_regions', 0);
}
if ($widget_columns > 0) : ?>
<?php
$i = 0;
while ($i < $widget_columns) : $i++;
if (is_active_sidebar('footer-'.$i)) : ?>
<?php dynamic_sidebar('footer-'.intval($i)); ?>
<?php endif;
endwhile; ?>
<?php endif;
?>
</div>
</footer>
</div>
<!-- /.footer-wrapper -->
<div class="footer-below-wrapper">
<footer id="footer-below">
<div class="footer-below-inner">
<?php
if (is_active_sidebar('footer-below-4')) {
$widget_columns = apply_filters('stormbringer_footer_below_widget_regions', 4);
} elseif (is_active_sidebar('footer-below-3')) {
$widget_columns = apply_filters('stormbringer_footer_below_widget_regions', 3);
} elseif (is_active_sidebar('footer-below-2')) {
$widget_columns = apply_filters('stormbringer_footer_below_widget_regions', 2);
} elseif (is_active_sidebar('footer-below-1')) {
$widget_columns = apply_filters('stormbringer_footer_below_widget_regions', 1);
} else {
$widget_columns = apply_filters('stormbringer_footer_below_widget_regions', 0);
}
if ($widget_columns > 0) : ?>
<?php
$i = 0;
while ($i < $widget_columns) : $i++;
if (is_active_sidebar('footer-below-'.$i)) : ?>
<?php dynamic_sidebar('footer-below-'.intval($i)); ?>
<?php endif;
endwhile; ?>
<?php endif;
?>
</div>
</footer>
</div>
<!-- /.footer-below-wrapper -->
<?php do_action( 'stormbringer_footer_after' ); ?>
</div>
<!-- /#wrapper -->
<?php wp_footer(); ?>
</body>
</html>