forked from WPChill/decode-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
124 lines (98 loc) · 4.62 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
<?php
/**
* The header for the theme.
*
* Displays all of the <head> section and everything up till <div id="content" class="site-content">
*
* @package Decode
*/
?><!DOCTYPE html>
<?php tha_html_before(); ?>
<html <?php language_attributes(); ?>>
<head>
<?php tha_head_top(); ?>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php if ( get_theme_mod( 'favicon_image', '' ) ) { echo '<link rel="icon" href="' . esc_url( get_theme_mod( 'favicon_image', '' ) ) . '">'; } ?>
<?php if ( get_theme_mod( 'favicon_image', '' ) ) { echo '<link rel="apple-touch-icon-precomposed" href="' . esc_url( get_theme_mod( 'favicon_image', '' ) ) . '">'; } ?>
<?php tha_head_bottom(); ?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php tha_body_top(); ?>
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'decode' ); ?></a>
<?php function decode_create_sidebar_link() {
if ( get_theme_mod( 'show_sidebar', true ) == true ) : ?>
<button id="sidebar-link" class="sidebar-link SidebarLink <?php echo get_theme_mod( 'sidebar_button_position', 'left' );?>" title="<?php _e( 'Show sidebar', 'decode' )?>">
<svg width="100%" height="100%" viewBox="0 0 240 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g class="menu-icon" fill-rule="evenodd">
<path d="M0,160 L0,200 L240,200 L240,160 L0,160 Z M0,160"></path>
<path d="M0,80 L0,120 L240,120 L240,80 L0,80 Z M0,80"></path>
<path d="M0,0 L0,40 L240,40 L240,0 L0,0 Z M0,0"></path>
</g>
</svg>
</button>
<?php endif;
}?>
<?php add_action( 'tha_header_before', 'decode_create_sidebar_link' ); ?>
<?php tha_header_before(); ?>
<?php if ( get_theme_mod( 'constant_sidebar', 'closing' ) == 'constant' && get_theme_mod( 'show_sidebar', true ) == true ) { echo '<div class="site-scroll">'; } ?>
<header id="masthead" class="site-header" role="banner">
<?php tha_header_top(); ?>
<div class="site-branding">
<?php function decode_create_header_image() {
if ( get_header_image() != '' ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img class="site-logo" src="<?php header_image(); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" width="100%" alt="">
</a>
<?php endif;
}
add_action( 'decode_header_image', 'decode_create_header_image' ); ?>
<?php decode_header_image(); ?>
<?php if ( get_theme_mod( 'show_site_title', true ) == true ) : ?>
<h1 class="site-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h1>
<?php endif; ?>
<?php if ( get_theme_mod( 'show_site_description', true ) == true ) : ?>
<?php if ( get_theme_mod( 'html_description', '' ) !== '' ) : ?>
<h2 class="site-description"><?php echo get_theme_mod( 'html_description' ); ?></h2>
<?php elseif ( get_theme_mod( 'html_description', '' ) == '' ) : ?>
<h2 class="site-description"><?php echo get_bloginfo( 'description' );?></h2>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ( get_theme_mod( 'show_header_social_icons', false ) == true ) {
get_template_part( 'social-links' );
} ?>
<?php if ( get_theme_mod( 'show_header_menu', true ) == true ) :
wp_nav_menu( array(
'theme_location' => 'header-menu',
'container' => false,
'menu_class' => 'menu horizontal-menu header-menu',
'menu_id' => 'header-menu',
'items_wrap' => '<nav id="%1$s" class="%2$s" role="navigation"><ul>%3$s</ul></nav><!-- #header-menu -->',
) );
endif; ?>
<?php tha_header_bottom(); ?>
</header><!-- #masthead -->
<?php tha_header_after(); ?>
<?php if ( (function_exists( 'bcn_display' ) || function_exists( 'breadcrumb_trail' )) && ! is_front_page() ) : ?>
<nav class="site-breadcrumbs" role="navigation">
<div class="site-breadcrumbs-container">
<?php if ( function_exists( 'bcn_display' ) ) {
bcn_display();
}
if ( function_exists( 'breadcrumb_trail' ) ) {
breadcrumb_trail();
} ?>
</div>
</nav><!-- .breadcrumbs -->
<?php endif; ?>
<div id="content" class="site-content">
<?php tha_content_top(); ?>