-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.php
123 lines (117 loc) · 3.89 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
<?php
/**
* The template for displaying the footer
*
*/
?>
</div>
<footer class="site-footer">
<div class="logo-strip">
<div class="inner">
<?php
$footer_logos = ['ouidad', 'bioionic', 'wetbrush', 'goody', 'epic-pro', 'solano', 'twist', 'curls', 'ace'];
foreach ($footer_logos as $id) {
include('assets/svg/' . $id . '-logo.svg');
}
?>
</div>
</div>
<?php
$footer = get_theme_mod('footer');
$case = $footer['case'];
?>
<div class="company-info<?= $footer['case'] ? ' use-uppercase' : '' ?>">
<div class="inner">
<?php if(!empty($footer['title'])) : ?>
<div class="title"><?= trim($footer['title']) ?></div>
<?php endif; ?>
<?php
if(!empty($footer['address'])) :
$mapLink = 'https://www.google.com/maps/search/?api=1&query=' . trim($footer['address']);
$mapLink = preg_replace('/\s+/', '+', $mapLink);
$mapLink = preg_replace('/\|/', ',', $mapLink);
?>
<a href="<?= $mapLink ?>" target="_blank" rel="noopener" class="address"><?= trim($footer['address']) ?></a>
<?php endif; ?>
<?php if(!empty($footer['phone'])) : ?>
<a href="tel:<?= preg_replace('/(.*?)(\d+)\D+(\d+)\D+(\d+)(.*)/', '$1-$2-$3', trim($footer['phone'])) ?>" rel="noopener" class="phone"><?= trim($footer['phone']) ?></a>
<?php endif; ?>
<?php if(!empty($footer['email'])) : ?>
<a href="mailto:<?= strtolower(trim($footer['email'])) ?>" rel="noopener" class="email"><?= trim($footer['email']) ?></a>
<?php endif; ?>
<?php if(!empty($footer['linkedin'])) : ?>
<a href="<?= trim($footer['linkedin']) ?>" target="_blank" rel="noopener" class="linkedin"><span class="icon"></span></a>
<?php endif; ?>
<nav>
<?php
wp_nav_menu([
'theme_location' => 'footer-menu',
'menu_id' => 'footer-nav',
'fallback_cb' => false
]);
?>
</nav>
</div>
</div>
<div class="copyright">
© <span class="year"><?= date('Y') ?></span> Beauty by Imagination.
</div>
</footer>
<div class="modal overlay">
<div class="panel">
<div class="btn-row">
<button class="close-btn" type="button">
<svg width="16" height="16"><use xlink:href="#x-icon" /></svg>
</button>
</div>
<div class="content">
<div class="image"></div>
<div class="text"></div>
</div>
</div>
</div>
<?php
if(is_front_page()) :
while(have_rows('popup')) : the_row();
$enabled = get_sub_field('enabled');
$image = get_sub_field('image');
$content = get_sub_field('content');
$identifier = get_sub_field('identifier');
$maxShows = get_sub_field('max_shows');
if(!$maxShows) $maxShows = 1;
if(empty($identifier)) $identifier = 'default';
$hasImage = !empty($image['url']);
if($enabled) :
?>
<div class="popup overlay" data-identifier="<?= $identifier ?>" data-max-shows="<?= $maxShows ?>">
<div class="panel<?= $hasImage ? ' with-image' : '' ?>">
<button class="close-btn" type="button">
<svg width="16" height="16"><use xlink:href="#x-icon" /></svg>
</button>
<div class="content">
<?php if($hasImage) : ?>
<div class="image"><img src="<?= esc_url($image['url']) ?>" alt="<?= esc_attr($image['alt']) ?>" /></div>
<?php endif; ?>
<div class="text"><?= $content ?></div>
</div>
</div>
<div class="cover"></div>
</div>
<?php
endif;
endwhile;
endif;
wp_footer();
?>
<div class="svg-symbols">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg">
<symbol id="x-icon" width="16" height="16" viewBox="0 0 16 16">
<g fill="white">
<rect y="1.14294" width="1.61623" height="21.011" transform="rotate(-45 0 1.14294)"/>
<rect x="1.14282" y="15.9999" width="1.61623" height="21.011" transform="rotate(-135 1.14282 15.9999)"/>
</g>
</symbol>
</svg>
</div>
</body>
</html>