/
header.php
139 lines (102 loc) · 4.3 KB
/
header.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
<!DOCTYPE html>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<meta name="google-site-verification" content="NPP7YiGqCJpvUheQKQWvRnh0uU_mBF7saSZIWqGuAhM" />
<?php
wp_head();
//
// Need to query Google AD scripts
//
$wp_query = new WP_Query();
$wp_query->query(array(
'post_type'=>'ad',
'posts_per_page' => -1
));
if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post();
$headerScript = get_field('header_script');
$enable = get_field('enable_ad');
if( $enable == 'Yes' ) :
if( $headerScript != '' ) { echo $headerScript; }
endif; // end if enabled
endwhile; endif; wp_reset_postdata(); wp_reset_query(); ?>
</head>
<body <?php body_class(); ?>>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=219473481428768";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="header">
<div id="main-nav-container">
<div class="wrapper">
<?php if(is_home()) { ?>
<h1 class="logo">
<a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a>
</h1>
<?php } else { ?>
<div class="logo">
<a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a>
</div>
<?php } ?>
<div id="header-social">
<ul>
<li class="facebook"><a href="https://www.facebook.com/pages/Untamed-Science/169220075768">Facebook</a></li>
<li class="twitter"><a href="https://twitter.com/UntamedScience">Twitter</a></li>
<li class="youtube"><a href="http://www.youtube.com/user/UntamedScience">Youtube</a></li>
</ul>
</div><!-- header-social -->
<div class="search-glass">
<ul>
<li>
<a href="#">Search</a>
<ul>
<li class="search-drop">
<?php get_template_part('includes/google-search'); ?>
<?php //get_template_part('includes/wordpress-search'); ?>
</li>
</ul>
</li>
</ul>
</div><!-- search open -->
<nav id="site-navigation" class="main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
</nav><!-- #site-navigation -->
</div><!-- wrapper -->
</div><!-- #navigation container -->
<div id="tree-nav-container">
<?php
if(is_front_page()) {
get_template_part('includes/posts-slider');
} elseif ( 'biodiversity' == get_post_type() || is_page('tree-of-life') || is_taxonomy('classification') ) {?>
<div id="tree-nav">
<?php wp_nav_menu( array( 'theme_location' => 'tree-of-life', 'menu_class' => 'tree-menu' ) ); ?>
</div><!-- #navigation -->
<?php } elseif ( 'biology' == get_post_type() || is_page('world-biology') || is_taxonomy('biology-class') ) { ?>
<div id="tree-nav">
<?php wp_nav_menu( array( 'theme_location' => 'biology', 'menu_class' => 'tree-menu' ) ); ?>
</div><!-- #navigation -->
<?php } ?>
</div><!-- #tree navigation container -->
</div><!-- #header -->
<?php
if(!is_front_page()) {
if ( function_exists('yoast_breadcrumb') ) { ?>
<div class="bread">
<div class="wrapper">
<?php $breadcrumbs = yoast_breadcrumb( '<li>', '</li>', false );
echo str_replace( '|', ' </li><li>', $breadcrumbs ); ?>
</div><!-- wrapper -->
</div><!-- bread -->
<?php }
}
?>
<div id="main" class="wrapper">