-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfooter.php
More file actions
164 lines (156 loc) · 7.55 KB
/
Copy pathfooter.php
File metadata and controls
164 lines (156 loc) · 7.55 KB
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
<?php
// Footer settings from ACF
$footer_logo = get_field('footer_logo', 'option');
$footer_description = get_field('footer_description', 'option') ?: 'We provide helpful information and resources to help you navigate government benefits and programs.';
$footer_columns = get_field('footer_columns', 'option');
$footer_copyright = get_field('footer_copyright', 'option') ?: '© {year} {site}. All rights reserved.';
$copyright_links = get_field('copyright_links', 'option');
// Footer Button settings
$footer_button_enabled = get_field('footer_button_enabled', 'option');
if ($footer_button_enabled === null) $footer_button_enabled = true;
$footer_button_text = get_field('footer_button_text', 'option') ?: 'Get Started';
$footer_button_url = get_field('footer_button_url', 'option') ?: '/contact/';
// Footer colors
$footer_bg_color = get_field('footer_background_color', 'option') ?: '#ffffff';
$footer_text_color = get_field('footer_text_color', 'option') ?: '#506276';
$footer_heading_color = get_field('footer_heading_color', 'option') ?: '#1a1a1a';
$footer_description_color = get_field('footer_description_color', 'option') ?: '#506276';
$copyright_bg_color = get_field('copyright_background_color', 'option') ?: '#E6E8EB';
$copyright_text_color = get_field('copyright_text_color', 'option') ?: '#506276';
// Parse copyright placeholders
$footer_copyright = str_replace(
array('{year}', '{site}'),
array(date('Y'), get_bloginfo('name')),
$footer_copyright
);
?>
<footer style="background-color: <?php echo esc_attr($footer_bg_color); ?>; color: <?php echo esc_attr($footer_text_color); ?>;">
<div class="c">
<div class="grid-50">
<div class="col-2-5">
<a class="logo" href="<?php echo get_home_url(); ?>">
<?php if ($footer_logo): ?>
<?php echo wp_get_attachment_image($footer_logo, 'full'); ?>
<?php else: ?>
<?php echo wp_get_attachment_image(get_field('logo', 'option'), 'full'); ?>
<?php endif; ?>
</a><!-- logo -->
<p style="color: <?php echo esc_attr($footer_description_color); ?>;"><?php echo esc_html($footer_description); ?></p>
<?php if ($footer_button_enabled): ?>
<a class="btn" href="<?php echo esc_url($footer_button_url); ?>"><?php echo esc_html($footer_button_text); ?></a>
<?php endif; ?>
<?php
$social_links = array(
'facebook' => array('icon' => 'fa-brands fa-facebook-f', 'url' => get_field('social_facebook', 'option')),
'twitter' => array('icon' => 'fa-brands fa-x-twitter', 'url' => get_field('social_twitter', 'option')),
'instagram' => array('icon' => 'fa-brands fa-instagram', 'url' => get_field('social_instagram', 'option')),
'linkedin' => array('icon' => 'fa-brands fa-linkedin-in','url' => get_field('social_linkedin', 'option')),
'youtube' => array('icon' => 'fa-brands fa-youtube', 'url' => get_field('social_youtube', 'option')),
);
$has_social = array_filter($social_links, function($s) { return !empty($s['url']); });
?>
<?php if (!empty($has_social)): ?>
<div class="footer-social">
<?php foreach ($has_social as $network => $s): ?>
<a href="<?php echo esc_url($s['url']); ?>" target="_blank" rel="noopener noreferrer" aria-label="<?php echo esc_attr(ucfirst($network)); ?>"><i class="<?php echo esc_attr($s['icon']); ?>"></i></a>
<?php endforeach; ?>
</div><!-- footer-social -->
<?php endif; ?>
</div><!-- col-2-5 -->
<div class="col-3-5">
<div class="grid-20 clear-col-3 footer-sections">
<?php if (!empty($footer_columns) && is_array($footer_columns)): ?>
<?php foreach ($footer_columns as $column): ?>
<div class="col-1-3">
<h3 style="color: <?php echo esc_attr($footer_heading_color); ?>;"><?php echo esc_html($column['title']); ?></h3>
<?php if (!empty($column['links']) && is_array($column['links'])): ?>
<ul>
<?php foreach ($column['links'] as $link): ?>
<li><a href="<?php echo esc_url($link['url']); ?>"><?php echo esc_html($link['text']); ?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div><!-- col-1-3 -->
<?php endforeach; ?>
<?php else: ?>
<!-- Fallback: show default columns if none configured -->
<div class="col-1-3">
<h3 style="color: <?php echo esc_attr($footer_heading_color); ?>;">Programs</h3>
<ul>
<li><a href="/veterans">Veterans Benefits</a></li>
<li><a href="/disability">Disability</a></li>
<li><a href="/healthcare">Healthcare</a></li>
</ul>
</div>
<div class="col-1-3">
<h3 style="color: <?php echo esc_attr($footer_heading_color); ?>;">Resources</h3>
<ul>
<li><a href="/blog">Blog</a></li>
<li><a href="/faq">FAQ</a></li>
<li><a href="/guides">Guides</a></li>
</ul>
</div>
<div class="col-1-3">
<h3 style="color: <?php echo esc_attr($footer_heading_color); ?>;">Company</h3>
<ul>
<li><a href="/about">About Us</a></li>
<li><a href="/contact">Contact</a></li>
<li><a href="/privacy-policy">Privacy Policy</a></li>
</ul>
</div>
<?php endif; ?>
</div><!-- grid-20 -->
</div><!-- col-3-5 -->
</div><!-- grid-50 -->
</div><!-- c -->
</footer>
<section class="copyright" style="background-color: <?php echo esc_attr($copyright_bg_color); ?>; color: <?php echo esc_attr($copyright_text_color); ?>;">
<div class="c">
<p><?php echo esc_html($footer_copyright); ?></p>
<?php if (!empty($copyright_links) && is_array($copyright_links)): ?>
<ul class="menu-copyright">
<?php foreach ($copyright_links as $link): ?>
<li><a href="<?php echo esc_url($link['url']); ?>" style="color: <?php echo esc_attr($copyright_text_color); ?>;"><?php echo esc_html($link['text']); ?></a></li>
<?php endforeach; ?>
</ul>
<?php else: ?>
<!-- Fallback: default copyright links -->
<ul class="menu-copyright">
<li><a href="/privacy-policy/">Privacy Policy</a></li>
<li><a href="/terms/">Terms of Service</a></li>
</ul>
<?php endif; ?>
</div><!-- c -->
</section><!-- copyright -->
<?php
$banner_button_action = get_field('homepage_banner_button_action', 'option');
?>
<!-- QUALIFICATION/SURVEY POPUP - Only render if popup action is selected -->
<?php if ($banner_button_action === 'popup'): ?>
<div class="dt-popup">
<div class="dt-popup-overlay"></div>
<div class="dt-popup-content">
<button class="dt-popup-close toggle-dt-popup" aria-label="Close popup">×</button>
<div class="dt-popup-body">
<?php echo get_popup_content(); ?>
</div>
</div>
</div>
<?php endif; ?>
<!-- WIDGET POPUP/MODAL - Only render if widget action is selected -->
<?php if ($banner_button_action === 'widget'): ?>
<div class="widget-popup">
<div class="widget-popup-overlay"></div>
<div class="widget-popup-content">
<button class="widget-popup-close" aria-label="Close widget">×</button>
<div class="widget-popup-body">
<!-- Content loaded via AJAX -->
</div>
</div>
</div>
<!-- NONCE for AJAX requests -->
<input type="hidden" name="widget_popup_nonce" value="<?php echo wp_create_nonce('widget_popup_nonce'); ?>">
<?php endif; ?>
<?php wp_footer(); ?>
</body>
</html>