-
Notifications
You must be signed in to change notification settings - Fork 1
/
footer.php
231 lines (196 loc) · 7.61 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
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the #content div and all content after
*
* @package understrap
*/
?>
<?php if (get_theme_mod( 'toggle_footer_widgets', 'true') == true) {
$col_counter = 0;
if (is_active_sidebar( 'footer-widget-1' )) {
$col_counter = $col_counter+1;
}
if (is_active_sidebar( 'footer-widget-2' )) {
$col_counter = $col_counter+1;
}
if (is_active_sidebar( 'footer-widget-3' )) {
$col_counter = $col_counter+1;
}
if (is_active_sidebar( 'footer-widget-4' )) {
$col_counter = $col_counter+1;
}
if ($col_counter != 0) {
$col_width = 12 / $col_counter;
}
if ($col_counter != 0) {
?>
<section id="footer-widgets">
<h1 class="sr-only"><?php echo esc_html__( 'Footer Widgets', 'understrap' ) ?></h1>
<div class="container-fluid">
<?php if ( is_active_sidebar( 'footer-widget-1' ) ) { ?>
<div class="col-sm-6 col-md-<?php echo $col_width; ?>">
<aside class="footer-widget widget-area" role="complementary">
<?php dynamic_sidebar( 'footer-widget-1' ); ?>
</aside>
</div><!-- .footer-widget-1 -->
<?php } ?>
<?php if ( is_active_sidebar( 'footer-widget-2' ) ) { ?>
<div class="col-sm-6 col-md-<?php echo $col_width; ?>">
<aside class="footer-widget widget-area" role="complementary">
<?php dynamic_sidebar( 'footer-widget-2' ); ?>
</aside>
</div><!-- .footer-widget-2 -->
<?php } ?>
<?php if ( is_active_sidebar( 'footer-widget-3' ) ) { ?>
<div class="col-sm-6 col-md-<?php echo $col_width; ?>">
<aside class="footer-widget widget-area" role="complementary">
<?php dynamic_sidebar( 'footer-widget-3' ); ?>
</aside>
</div><!-- .footer-widget-2 -->
<?php } ?>
<?php if ( is_active_sidebar( 'footer-widget-4' ) ) { ?>
<div class="col-sm-6 col-md-<?php echo $col_width; ?>">
<aside class="footer-widget widget-area" role="complementary">
<?php dynamic_sidebar( 'footer-widget-4' ); ?>
</aside>
</div><!-- .footer-widget-2 -->
<?php } ?>
</div>
</section><!-- #footer-widgets -->
<?php }
}?>
<div class="" id="wrapper-footer">
<footer id="colophon" class="container-fluid site-footer" role="contentinfo">
<div class="pull-left">
<?php if ( get_theme_mod( 'footer_show_wp_credits', 'true') == 'true' ) { ?>
<img src="<?php echo get_template_directory_uri(); ?>/imgs/wordpress-icon.png" height="16" width="16" alt="<?php printf( esc_html__( 'Proudly powered by %s', 'understrap' ), 'WordPress' ); ?>"> <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'understrap' ) ); ?>" target="_blank"><?php printf( esc_html__( 'Proudly powered by %s', 'understrap' ), 'WordPress' ); ?></a><?php
} ?>
<?php if ( get_theme_mod( 'footer_show_custom_footer_text', 'true') =='true' ) { // Is Footer text activated?
if ( get_theme_mod( 'footer_show_wp_credits') == 'true' ) { ?><span class="sep"> | </span><?php } ?>
<span>
© <?php echo date('Y');
if ( get_theme_mod( 'footer_custom_footer_text_link', 'http://tarcgn.de/portfolio/') !='' ) { ?>
<a href="<?php echo get_theme_mod( 'footer_custom_footer_text_link'); ?>" target="_blank">
<?php } ?>
<?php echo get_theme_mod( 'footer_custom_footer_text', 'Theme by Thomas A. Reinert | TAR MediaDesign'); ?>
<?php if ( get_theme_mod( 'footer_custom_footer_text_link', 'http://tarcgn.de/portfolio/') !='' ) { ?>
</a>
<?php } ?>
</span>
<?php
} ?>
</div>
<?php if( has_nav_menu( 'footer' ) ) { ?>
<nav id="footer-menu" class="pull-right">
<h1 class="sr-only"><?php echo esc_html__( 'Secondary Navigation', 'understrap' ) ?></h1>
<?php
$footer_menu_parameters = array(
'theme_location' => 'footer',
'echo' => false,
'items_wrap' => '%3$s',
'depth' => 1,
);
echo strip_tags(wp_nav_menu( $footer_menu_parameters ), '<a>' );?>
</nav>
<?php } ?>
</footer><!-- #colophon -->
</div><!-- wrapper end -->
</div><!-- #page -->
<?php if (get_theme_mod('display_to_top_button') == true) { // To Top Button ?>
<a href="#top" class="page-scroll" id="topbutton"><span class="fa fa-arrow-circle-o-up"></span><span class="sr-only"><?php echo __( 'To Top', 'understrap' ); ?></span></a>
<?php } ?>
<?php wp_footer(); ?>
<!-- Loads slider script and settings if a widget on pos hero is published -->
<?php if ( is_active_sidebar( 'hero' ) ): ?>
<script>
jQuery(document).ready(function() {
var owl = jQuery('.owl-carousel');
owl.owlCarousel({
items:<?php echo get_theme_mod( 'understrap_theme_slider_count_setting', 1 );?>,
loop:<?php echo get_theme_mod( 'understrap_theme_slider_loop_setting', true );?>,
autoplay:true,
autoplayTimeout:<?php echo get_theme_mod( 'understrap_theme_slider_time_setting', 5000 );?>,
animateOut: 'fadeOut',
animateIn: 'fadeIn',
nav: false,
dots: true,
autoplayHoverPause:true,
margin:0,
autoHeight:true,
video: true
});
jQuery('.play').on('click',function(){
owl.trigger('autoplay.play.owl',[1000])
});
jQuery('.stop').on('click',function(){
owl.trigger('autoplay.stop.owl')
});
});
</script>
<?php endif; ?>
<script>
// Off Canvas Nav Menu
jQuery(document).ready(function(){
//Navigation Menu Slider
jQuery('#nav-expander').on('click',function(e){
e.preventDefault();
jQuery('body').toggleClass('nav-expanded');
});
jQuery('#nav-close').on('click',function(e){
e.preventDefault();
jQuery('body').removeClass('nav-expanded');
});
// Initialize navgoco with default options
jQuery(".main-menu").navgoco({
caret: '',
accordion: false,
openClass: 'open',
save: true,
cookie: {
name: 'navgoco',
expires: false,
path: '/'
},
slide: {
duration: 300,
easing: 'swing'
}
});
});
jQuery(document).keyup(function(e) {
if (e.keyCode == 27) {
if (jQuery('body').hasClass('nav-expanded')) {
e.preventDefault();
jQuery('body').removeClass('nav-expanded');
}
}
});
jQuery(document).ready(function(){
jQuery('a').click(function(){
var href = jQuery(this).attr("href");
jQuery('body').animate({
scrollTop: jQuery(href).offset().top
}, 1000);
});
});
jQuery(document).scroll(function() {
var y = jQuery(this).scrollTop();
if (y > 800) {
jQuery('#topbutton').fadeIn();
} else {
jQuery('#topbutton').fadeOut();
}
});
jQuery.material.init();
jQuery.material.options = {
"withRipples": "a, .submit,input[type=submit], .btn"
}
jQuery.material.ripples()
</script>
<?php if (!ctype_space(get_theme_mod('javascript_footer_code', 'false') ) ) {
echo get_theme_mod('javascript_footer_code');
} ?>
</body>
</html>