-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathheader.php
More file actions
81 lines (75 loc) · 3.38 KB
/
header.php
File metadata and controls
81 lines (75 loc) · 3.38 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
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <main id="main">
*
* @package Melany
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php if ( get_theme_mod( 'melany_favicon' ) ) : ?>
<link rel="shortcut icon" href="<?php echo get_theme_mod( 'melany_favicon' ); ?>" />
<?php else : ?>
<link rel="shortcut icon" href="<?php echo get_template_directory_uri() . '/img/favicon.png'; ?>" />
<?php endif; ?>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'before' ); ?>
<div id="scroll">
<header id="masthead" <?php melany_header_class(); ?> role="banner">
<?php // Brand and toggle get grouped for better mobile display ?>
<div class="navbar-header" role="banner">
<button type="button" class="navbar-toggle menu-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse" data-parent="#site-header">
<span class="sr-only"><?php echo __( 'Toggle navigation', 'melany' ); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<button type="button" class="search-toggle" data-toggle="collapse" data-target=".search-collapse" data-parent="#site-header">
<span class="sr-only"><?php echo __( 'Toggle search', 'melany' ); ?></span>
<span class="glyphicon glyphicon-search"></span>
</button>
<?php $name = get_bloginfo( 'name', 'display' );
$length = get_theme_mod( 'melany_title_length' ); ?>
<a class="navbar-brand site-branding" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php melany_site_name( $name, $length ); ?></a>
</div><!-- .navbar-header -->
<?php // Collect the nav links, forms, and other content for toggling ?>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<nav id="site-navigation" class="main-navigation" role="navigation">
<h1 class="sr-only"><?php _e( 'Menu', 'melany' ); ?></h1>
<div class="sr-only skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'melany' ); ?>"><?php _e( 'Skip to content', 'melany' ); ?></a></div>
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => false,
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'Bootstrap_Walker::fallback',
'depth' => 2,
'walker' => new Bootstrap_Walker,
) ); ?>
</nav><!-- #site-navigation -->
</div><!-- .navbar-collapse -->
<div class="collapse search-collapse">
<?php get_search_form( true ); ?>
</div>
</header><!-- #masthead -->
<?php do_action( 'melany_header_after' ); ?>
<div id="page" class="container hfeed site">
<section id="content" class="site-content">
<main id="main" class="row" role="main">
<?php // Prevent custom header image or logo section to be shown on static home pages ?>
<?php if ( ! is_page_template('templates/home.php') || is_home() ) : ?>
<?php // Prevent logo section to be shown on image post format
if ( ! has_post_format( 'image' ) )
melany_logo( 'logo' ); ?>
<?php endif; // !is_front_page() || is_home() ?>