-
Notifications
You must be signed in to change notification settings - Fork 1
/
footer.php
executable file
·263 lines (209 loc) · 7.66 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
261
262
263
<?php
/**
* The template for displaying the footer
*
* Contains the closing of the #content div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WP_Bootstrap_Starter
*/
if(get_theme_mod('footer_ad_space'))
$ad_url = get_theme_mod('footer_ad_space');
$social_links = ['facebook','instagram','twitter','linkedin'];
?>
<?php if(!is_page_template( 'blank-page.php' ) && !is_page_template( 'blank-page-with-container.php' )): ?>
</div><!-- .row -->
</div><!-- .container -->
</div><!-- #content -->
<?php get_template_part( 'footer-widget' ); ?>
<?php endif; ?>
</div><!-- #page -->
<?php wp_footer(); ?>
<!-- <hr> -->
<div class="col-sm-12 center" style="margin-top:5%;">
<h3 class="center theme-font-color">Explore Templates</h3>
<?php get_search_form(); ?>
<a href="<?= (get_theme_mod('footer_ad_link'))? addhttp(get_theme_mod('footer_ad_link')) : '#' ; ?>" target="_blank">
<?php if (isset($ad_url)): ?>
<?php if (get_theme_mod('footer_ad_width') && get_theme_mod('footer_ad_height')): ?>
<div class="my_ad_space" style="background-image:url('<?= $ad_url ?>');
width:<?= get_theme_mod('footer_ad_width') ?>%;
height:<?= get_theme_mod('footer_ad_height') ?>px ">
<?php else: ?>
<div class="my_ad_space" style="background-image:url('<?= $ad_url ?>');">
<?php endif ?>
<?php else: ?>
<div class="my_ad_space" style="background-color: #f1f1f1;">
AD SPACE
<?php endif ?>
</div>
</a>
</div>
<div class="dm_footer col-sm-12">
<h2 class="theme-font-color">Contact Us</h2>
<div class="row">
<div class="col-sm-6" style="margin:0 auto">
<?php foreach ($social_links as $link): ?>
<span style="marign-left:2%;margin-right:2%;">
<?php $name = 'social_'.$link.'_link'; ?>
<?php if (get_theme_mod($name) && get_theme_mod($name) != "" ): ?>
<a target="_blank" href="<?= get_theme_mod($name) ?>"><i class="fa fa-2x fa-<?= $link ?>"></i></a>
<?php endif ?>
</span>
<?php endforeach ?>
</div>
</div>
<div class="row" style="padding-left:15%;padding-right:15%;clear:both;">
<div style="width:100%;margin:0 auto;position:relative;">
<?php if (get_theme_mod('contact_info_phone_1') || get_theme_mod('contact_info_phone_2')): ?>
<div class="col-xs-12 footer-section">
<i class="fa fa-2x fa-phone theme-font-color"></i>
</br>
</br>
<?php if (get_theme_mod('contact_info_phone_1')): ?>
<?= get_theme_mod('contact_info_phone_1') ?>
<?php endif ?>
</br>
<?php if (get_theme_mod('contact_info_phone_2')): ?>
<?= get_theme_mod('contact_info_phone_2') ?>
<?php else: ?>
</br>
<?php endif ?>
</div>
<?php endif ?>
<?php if (get_theme_mod('contact_info_email')): ?>
<div class="col-xs-12 footer-section">
<i class="fa fa-2x fa-envelope theme-font-color"></i>
</br>
</br>
<span><?= (get_theme_mod('contact_info_email'))? get_theme_mod('contact_info_email') : 'Email' ;?></span>
</br>
<a href="mailto:<?= get_theme_mod('contact_info_email') ?>" target="_top">Contact Us</a>
</div>
<?php endif ?>
<?php if (get_theme_mod('contact_info_address_1') || get_theme_mod('contact_info_address_2')): ?>
<div class="col-xs-12 footer-section">
<i class="fa fa-2x fa-map-marker theme-font-color"></i>
</br>
</br>
<?php if (get_theme_mod('contact_info_address_1')): ?>
<?= get_theme_mod('contact_info_address_1') ?>
<?php endif ?>
</br>
<?php if (get_theme_mod('contact_info_address_2')): ?>
<?= get_theme_mod('contact_info_address_2') ?>
<?php else: ?>
</br>
<?php endif ?>
</div>
<?php endif ?>
</div>
</div>
</div>
<footer id="colophon" class=" center site-footer <?php echo wp_bootstrap_starter_bg_class(); ?>" role="contentinfo">
<div class="site-info">
© <?php echo date('Y'); ?> <?php echo '<a href="'.home_url().'">'.get_bloginfo('name').'</a>'; ?>
<span class="sep"> | Home</span>
</div>
</footer>
</body>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function(){
if($("#myVideo").length != 0){
$("#myVideo").bind("loadedmetadata", function () {
var width = this.videoWidth;
var height = this.videoHeight;
if(width == 420 && height == 160)
$("#myVideo").css('object-fit','contain');
else
$("#myVideo").css('object-fit','cover');
});
}
if($(".canvas_title").length != 0){
var height = $(".canvas_title").height();
while(height >= 30){
var font_size = $(".canvas_title").css('font-size');
font_size = parseInt(font_size);
font_size = font_size*0.9;
$(".canvas_title").css('font-size',font_size+'px');
height = $(".canvas_title").height();
}
}
// var primary_color = $("a").css('color');
var primary_color = $(":root").css('--primary');
var secondary_color = $(":root").css('--secondary');
$(".theme-font-color").css('color',primary_color);
$(".dm_footer .borders").css('border-color',primary_color);
$(".wide_banner").css('background-color',primary_color);
$(".after_price").css('border-color',primary_color);
$(".search_input").css('border-color',primary_color);
adjustFonts();
checkHoverVideos();
var logo_color = $(".site-title").css('color');
var nav_bar_color = $(".navbar-static-top").css('background-color');
if(logo_color == nav_bar_color)
$(".site-title").css('color',secondary_color);
$('.canvas_video').hover(function toggleControls() {
this.setAttribute("controls", "controls")
});
$('.canvas_video').mouseleave(function toggleControls() {
this.removeAttribute("controls")
});
var original_product_bg = $(".product_in_loop").css('background-color');
$(".product_in_loop").hover(function(){
$(this).css('background-color',primary_color);
$(this).find('a').css('color',secondary_color);
});
$(".product_in_loop").mouseleave(function(){
$(this).css('background-color',original_product_bg);
$(this).find('a').css('color',primary_color);
});
});
function checkHoverVideos(){
if($(".hover_video").length != 0){
$('.hover_video').hover(function() {
$(this).get(0).play();
});
$('.hover_video').mouseleave(function() {
$(this).get(0).pause();
})
}
}
function adjustFonts(){
if($(".product_div h2").length != 0){
var check = false;
while(!check){
console.log('font-resizing');
var div_height = parseInt($(".product_div").css('height'));
var h2_height = parseInt($(".product_div h2").css('height'));
var h2_font = $(".product_div h2").css('font-size');
var h2_font = parseInt(h2_font.split('px')[0]);
var percentage =(h2_height/div_height)*100;
if(percentage > 30){
var new_font_size = parseInt((h2_font*90)/100);
$(".product_div h2").css('font-size',new_font_size+'px');
}else{
break;
}
}
}
if($(".dynamic_content").length != 0){
while(1==1){
var height = parseInt($('.dynamic_content').css('height'));
var parent_height = parseInt($('.dynamic_content_parent').css('height'));
var font = $(".dynamic_content").css('font-size');
var percentage =(height/parent_height)*100;
if(percentage > 70){
var new_font_size = parseInt(font)*90;
new_font_size = parseInt(new_font_size/100);
$(".dynamic_content").css('font-size',new_font_size+'px');
}else{
break;
}
}
}
}
</script>
</html>