-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
107 lines (95 loc) · 2.73 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
<?php
/**
* The header for our theme
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
* @package Nightingale
* @copyright NHS Leadership Academy, Tony Blacker
* @version 1.1 21st August 2019
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="theme" content="NHS-nightingale-2.2.0">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php
wp_enqueue_script( 'jquery' );
wp_head();
flush();
?>
</head>
<body <?php body_class( 'js-enabled' ); ?>>
<?php
if ( ! function_exists( 'wp_body_open' ) ) {
/**
* Open the body tag, pull in any hooked triggers.
**/
function wp_body_open() {
do_action( 'wp_body_open' );
}
}
wp_body_open();
?>
<?php do_action( 'nightingale_after_body' ); ?>
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'nightingale' ); ?></a>
<?php
$header_layout = get_theme_mod( 'logo_type', 'transactional' );
$header_colour = get_theme_mod( 'header_styles', 'normal' );
if ( 'normal' !== $header_colour ) {
$header_colour_text = ' nhsuk-header--white';
} else {
$header_colour_text = '';
}
echo '<header class="nhsuk-header nhsuk-header--' . esc_attr( $header_layout . $header_colour_text ) . '" role="banner">';
?>
<div class="nhsuk-header__container">
<?php
get_template_part( 'partials/logo' );
?>
<div class="nhsuk-header__content" id="content-header">
<?php
$header_search = get_theme_mod( 'show_search', 'yes' );
if ( 'no' === $header_search ) {
$headersearchextra = 'nhsuk-header__menu--only';
} else {
$headersearchextra = '';
}
?>
<?php
if ( is_user_logged_in() ) {
get_template_part( 'template-parts/buddy-header' );
}
if ( 'yes' === $header_search ) {
?>
<div class="nhsuk-header__search">
<?php get_search_form(); ?>
</div>
<?php
}
?>
</div>
</div>
<?php
get_template_part( 'partials/topnav' );
?>
</header>
<?php
if( $page_tabbed = get_post_meta( get_the_id(), 'tabbed-page', true ) ) {
get_template_part( 'partials/tabs' );
} else {
echo nightingale_breadcrumb(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
<?php
$page_color = get_post_meta( get_the_id(), 'page-color', true );
$extra_styles = $page_color ? 'page-style--' . $page_color : '';
?>
<div id="content" class="nhsuk-width-container-full">
<main class="nhsuk-main-wrapper nhsuk-main-wrapper--no-padding <?php echo esc_attr( $extra_styles ); ?>" id="maincontent">
<div id="contentinner" class="nhsuk-width-container">
<?php
flush();