-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheader.php
More file actions
44 lines (39 loc) · 2.42 KB
/
header.php
File metadata and controls
44 lines (39 loc) · 2.42 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
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header class="site-header">
<div class="container">
<h1 class="school-logo-text float-left"><a href="<?php echo site_url()?>"><strong>WP</strong> University</a></h1>
<!-- Search on Mobile -->
<a href="<?php echo esc_url(site_url('/search')); ?>" class="js-search-trigger site-header__search-trigger"><i class="fa fa-search" aria-hidden="true"></i></a>
<i class="site-header__menu-trigger fa fa-bars" aria-hidden="true"></i>
<div class="site-header__menu group">
<nav class="main-navigation">
<ul>
<?php
$parent = get_post($post->post_parent);
$parentSlug = $parent->post_name;
?>
<!-- highlight menu item when parent/child page is active or
when when menu item matches the post type being displayed -->
<li <?php if( is_page('about-us') or ( $parentSlug == 'about-us' )) echo 'class="current-menu-item"' ?>><a href="<?php echo site_url('/about-us')?>">About Us</a></li>
<li <?php if ( get_post_type() == 'program' ) echo 'class="current-menu-item"' ?>><a href="<?php echo get_post_type_archive_link('program') ?>">Programs</a></li>
<li <?php if( get_post_type() == 'event' OR is_page('past-events') ) echo 'class="current-menu-item"' ?>><a href="<?php echo get_post_type_archive_link('event') ?>">Events</a></li>
<li <?php if ( get_post_type() == 'campus' ) echo 'class="current-menu-item"' ?>><a href="<?php echo get_post_type_archive_link('campus') ?>">Campuses</a></li>
<li <?php if( get_post_type() == 'post' ) echo 'class="current-menu-item"' ?>><a href="<?php echo site_url('/blog'); ?>">Blog</a></li>
</ul>
</nav>
<div class="site-header__util">
<a href="#" class="btn btn--small btn--orange float-left push-right">Login</a>
<a href="#" class="btn btn--small btn--dark-orange float-left">Sign Up</a>
<!-- Search on Desktop -->
<a href="<?php echo esc_url(site_url('/search')); ?>" class="search-trigger js-search-trigger"><i class="fa fa-search" aria-hidden="true"></i></a>
</div>
</div>
</div>
</header>