-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.php
120 lines (117 loc) · 4.97 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
<?php
/**
* The template for displaying the footer
*
* Contains footer content and the closing of the #main and #page div elements.
*
* @package wp_oese_theme
* @since 1.5.0
*/
?>
<?php if ('resource'==get_post_type() && !is_search()): ?>
<?php
get_template_part('template-parts/nalrc/footer');
?>
</div>
<?php endif; ?>
<?php
$menuLocations = get_nav_menu_locations();
$menuID = $menuLocations['footer'];
$footerNav = wp_get_nav_menu_items($menuID);
$childMenuItems = array();
$parentMenuItems = array();
$items= array();
if($footerNav) {
foreach ($footerNav as $key => $navItems) {
// print_r($navItems);
if($navItems->menu_item_parent == 0){
$parentMenuItems[$navItems->ID]=array('title'=>$navItems->title,'url'=>$navItems->url);
}
else{
$childMenuItems[$navItems->menu_item_parent][]=array('title'=>$navItems->title,'url'=>$navItems->url);
}
}
}
$show_address = get_option('wp_oese_theme_display_footer_address');
?>
<div class="oese-footer-section">
<div class="row oese-date-modified-section">
<div class="col-md-12 oese-lastModified pull-right">
<span>Last Modified: <?php echo the_modified_date('m/d/Y') ?></span>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="row custom-common-padding footer-main-section mr-0 ml-0">
<?php
$parentIndex = 1;
$parentItemCount = count($parentMenuItems);
foreach ($parentMenuItems as $key => $menuItems) {
?>
<div class="footer-menu-item-wrap">
<div class="footer-title">
<p><a href="<?php echo $menuItems['url']; ?>"><?php echo $menuItems['title']; ?></a></p>
</div>
<div class="footer-sub-menu">
<?php
if (isset($childMenuItems[$key])) {
$childMenu = $childMenuItems[$key];
if($childMenu){ ?>
<ul class='sub-menu-links'>
<?php foreach ($childMenu as $key => $value) { ?>
<li>
<a href="<?php echo $value['url']; ?>">
<?php echo $value['title']; ?>
</a>
</li>
<?php } ?>
</ul>
<?php
}
}
if (($parentIndex==$parentItemCount) && !empty($show_address)){
?>
<div class="address">
U.S. Department of Education
<br />
400 Maryland Ave SW
<br />
Washington D.C. 20202-6244
</div>
<?php
}
?>
</div>
</div>
<?php
$parentIndex++;
} ?>
</div>
</div>
<div class="col-md-12">
<div class="row bottom-footer-section mr-0 ml-0">
<div class="col-md-2">
<div class="footer-bottom-left-logo">
<a href="https://www.ed.gov/" title="U.S. Department of Education Home (opens in new window)">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/footer_logo.png" alt="U.S. Department of Education Logo">
</a>
</div>
</div>
<div class="col-md-10">
<div class="footer-bottom-right-links text-right">
<?php
$menu_location = "sub-footer";
if ( has_nav_menu($menu_location) )
wp_nav_menu(array('theme_location' => $menu_location, 'menu_class' => 'nav-menu nav-sub-footer'));
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php wp_footer(); ?>
</body>
</html>