This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.php
171 lines (151 loc) · 5.96 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
<?php
$foot_signature = get_option('logo');
$template_dir = get_template_directory_uri();
?>
<footer id="footer" role="contentinfo" class="footer">
<div class="footer__dept">
<div class="footer__dept--wrapper">
<img class="footer__dept--logo" src="<?php echo $template_dir; ?>/images/ucla_logo_white.svg" />
<div class="footer__dept--info">
<address class="footer__dept--contact">
<?php // get the footer heading from theme options
if (myprefix_get_theme_option('address_heading') !== null) {
$address_heading = myprefix_get_theme_option('address_heading');
echo '<p class="p-org">' . $address_heading . '</p>';
} ?>
<?php // get the f ooter address from theme options
if (myprefix_get_theme_option('address_input_one') !== null) {
$address_one = myprefix_get_theme_option('address_input_one');
$address_two = myprefix_get_theme_option('address_input_two');
echo '<p class="p-street-address">' . $address_one . '<br/>' . $address_two . '</p>';
} else {
?>
<p class="p-street-address">
10889 Wilshire Blvd., Suite 1400<br>
Los Angeles, CA 90024
</p>
<?php
} ?>
<?php if (myprefix_get_theme_option('phone_input') !== null || myprefix_get_theme_option('email_input') !== null) {
echo '<br>';
} ?>
<?php // get the footer address from theme options
if (myprefix_get_theme_option('phone_input') !== null) {
$phone = myprefix_get_theme_option('phone_input');
echo '</br><p><a class="p-tel" href="tel:' . str_replace(['(', ')', ' ', '-'], '', $phone) . '">' . $phone . '</a></p>';
} ?>
<?php // get the footer address from theme options
if (myprefix_get_theme_option('email_input') !== null) {
$email = myprefix_get_theme_option('email_input');
echo '<p><a class="u-email" href="mailto:' . $email . '">' . $email . '</a></p>';
} ?>
</address>
<?php
// $companies = ['Facebook', 'Instagram', 'Twitter', 'Snapchat', 'LinkedIn', 'YouTube', 'TikTok'];
$footer_social = [
[
'company' => 'Facebook',
'url' => 'https://www.facebook.com/UCLA/'
],
[
'company' => 'Twitter',
'url' => 'https://twitter.com/ucla'
],
[
'company' => 'Instagram',
'url' => 'https://www.instagram.com/ucla/'
],
[
'company' => 'Snapchat',
'url' => 'https://www.snapchat.com/add/uclaofficial'
],
[
'company' => 'LinkedIn',
'url' => 'https://www.linkedin.com/company/ucla'
],
[
'company' => 'YouTube',
'url' => 'https://www.youtube.com/user/UCLA'
],
[
'company' => 'TikTok',
'url' => 'https://www.tiktok.com/@ucla'
]
];
$has_dept_social_links = false;
$social_list = '<div id="footer-social-menu" class="footer__dept--social">';
foreach ($footer_social as $social) {
$lsocial = strtolower($social['company']);
$url = myprefix_get_theme_option("${lsocial}_input");
if (is_null($url)) {
continue;
}
$has_dept_social_links = true;
// $social_list .= <<<EOT
// <a class="foot-$lcompany footer__dept--social-$lcompany" href="$url">
// <img src="$template_dir/images/icons/social/$lcompany--white.svg" alt="$company" />
// </a>
// EOT;
$social_list .= sprintf(
'<a href="%1$s" class="foot-%2$s footer__dept--social-%2$s"><img src="'. $template_dir .'/images/icons/social/%2$s--white.svg" alt="%3$s" /></a>',
$social['url'],
$lsocial,
$social['company']
);
}
$social_list .= '</div>';
if ($has_dept_social_links) {
echo $social_list;
}
?>
</div>
<?php if (has_nav_menu('foot-menu')) { ?>
<?php wp_nav_menu([
'theme_location' => 'foot-menu',
'container' => 'nav',
'container_class' => 'footer__dept--links-wrapper',
'menu_class' => '',
'depth' => 2,
]); ?>
</div>
<?php } ?>
</div>
</div>
<div class="ucla campus foot-lower">
<div class="foot-lower-wrap">
<div class="foot-lower-social">
<h2 class="visuallyhidden">Social Media</h2>
<ul>
<?php
foreach ($footer_social as $social) {
//echo $social['company'];
echo '
<li>
<a href="'.$social['url'].'" title="UCLA '.$social['company'].'">
<span class="social-icon social-icon--'.strtolower($social['company']).'"></span>
<span class="visuallyhidden">'.$social['company'].'</span>
</a>
</li>
';
}
?>
</ul>
</div>
<div class="foot-lower-info">
<div class="foot-lower-copyright">
©<?php echo date('Y'); ?> Regents of the <a href="https://www.universityofcalifornia.edu/">University of California</a>
</div>
<div class="foot-lower-toc">
<ul>
<li><a href="https://www.bso.ucla.edu/">Emergency</a></li>
<li><a href="http://www.ucla.edu/accessibility">Accessibility</a></li>
<li><a href="http://www.ucla.edu/terms-of-use/">Privacy & Terms of Use</a></li>
</ul>
</div>
</div>
</div>
</div>
</footer>
<?php wp_footer(); ?>
</body>
</html>