-
Notifications
You must be signed in to change notification settings - Fork 2
/
header.php
88 lines (79 loc) · 3.02 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
<?php
/**
* The header for our theme
*
* Displays all of the <head> section and everything up till the main content
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Rosa
* @since Rosa Lite 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ){
exit; // Exit if accessed directly
}
$class_name = 'header--sticky nav-scroll-hide';
// Make the header menu bar transparent, but only for static pages.
if ( is_page() ) {
$make_transparent_menu_bar = get_post_meta( get_the_ID(), rosa_lite_prefix() . 'header_transparent_menu_bar', true );
if ( $make_transparent_menu_bar == 'on' ) {
$class_name .= ' header--transparent';
}
}
$data_smoothscrolling = ( 1 == pixelgrade_option( 'use_smooth_scroll', 1 ) ) ? 'data-smoothscrolling' : '';
$data_main_color = ( pixelgrade_option( 'main_color', '#C59D5F' ) ) ? 'data-color="' . esc_attr( pixelgrade_option( 'main_color', '#C59D5F' ) ) . '"' : '';
?><!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="profile" href="https://gmpg.org/xfn/11" />
<![if IE]>
<script type='text/javascript'>
if(/*@cc_on!@*/false)
var isIe = 1;
</script>
<![endif]>
<?php wp_head(); ?>
</head>
<body <?php body_class( $class_name ); echo ' ' . $data_smoothscrolling . ' ' . $data_main_color; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php wp_body_open() ?>
<div id="page" class="page">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', '__theme_txtd' ); ?></a>
<div class="site-header header--inversed js-header">
<div class="container">
<div class="flexbox">
<div class="flexbox__item">
<button class="nav-trigger js-nav-trigger">
<span class="nav-icon"></span>
</button>
</div>
<div class="flexbox__item branding-container">
<?php get_template_part( 'template-parts/branding' ); ?>
</div>
<div class="flexbox__item">
<?php
$theme_locations = get_nav_menu_locations();
$has_main_menu = false;
if ( isset( $theme_locations['main_menu'] ) && ( $theme_locations['main_menu'] != 0 ) ) {
$has_main_menu = true;
} ?>
<nav class="navigation navigation--main<?php echo ( ! $has_main_menu ) ? ' no-menu' : ''; ?>" id="js-navigation--main">
<h2 class="accessibility"><?php esc_html_e( 'Primary Navigation', '__theme_txtd' ) ?></h2>
<?php
wp_nav_menu( array(
'theme_location' => 'main_menu',
'menu' => '',
'container' => '',
'container_id' => '',
'menu_class' => 'nav nav--main nav--items-menu',
'menu_id' => '',
'fallback_cb' => 'rosa_lite_please_select_a_menu_fallback',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
) ); ?>
</nav>
<div class="nav-overlay"></div>
</div>
</div><!-- .flexbox -->
</div><!-- .container -->
</div><!-- .site-header -->