forked from brettjonesdev/onetone-custom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
executable file
·67 lines (63 loc) · 2.37 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
<?php
/**
* The header for home page.
*
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php wp_title('|', true, 'right'); ?></title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php if(is_home()){$wrap_class = "home-site";}else{$wrap_class = "site";}?>
<div class="<?php echo $wrap_class;?>">
<header class="home-header">
<div class="home-logo onetone-logo ">
<a href="<?php echo esc_url(home_url('/')); ?>">
<?php if ( onetone_options_array('logo')!="") { ?>
<img src="<?php echo onetone_options_array('logo'); ?>" alt="<?php bloginfo('name'); ?>" />
<?php }else{ ?>
<span class="site-name">
<?php bloginfo('name'); ?>
</span>
<?php }?>
</a>
<?php if ( 'blank' != get_header_textcolor() && '' != get_header_textcolor() ){?>
<div class="site-description "><?php bloginfo('description'); ?></div>
<?php }?>
</div>
<a class="home-navbar navbar" href="javascript:;"></a>
<nav class="home-navigation top-nav">
<?php
$onepage_menu = '';
$section_num = onetone_options_array( 'section_num' );
if(isset($section_num) && is_numeric($section_num ) && $section_num >0):
for( $i = 0; $i < $section_num ;$i++){
$section_menu = onetone_options_array( 'menu_title_'.$i );
$section_slug = onetone_options_array( 'menu_slug_'.$i );
if(isset($section_menu) && $section_menu !=""){
$sanitize_title = sanitize_title($section_menu);
$section_menu = onetone_options_array( 'menu_title_'.$i );
if(trim($section_slug) !=""){
$sanitize_title = $section_slug;
}
$onepage_menu .= '<li class="onetone-menuitem"><a class="onetone-menu-link" id="onetone-menu-'.$sanitize_title.'" href="#'.$sanitize_title.'" >
<span>'.$section_menu.'</span></a></li>';
}
}
endif;
if ( has_nav_menu( "home_menu" ) ) {
wp_nav_menu(array('theme_location'=>'home_menu','depth'=>0,'fallback_cb' =>false,'container'=>'','container_class'=>'main-menu','menu_id'=>'menu-main','menu_class'=>'main-nav','link_before' => '<span>', 'link_after' => '</span>','items_wrap'=> '<ul id="%1$s" class="%2$s">'.$onepage_menu.'%3$s</ul>'));
}
else{
echo '<ul>'.$onepage_menu.'</ul>';
}
?>
</nav>
<div class="clear"></div>
</header>
<!--header-->