-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathheader.php
More file actions
147 lines (127 loc) · 6.38 KB
/
header.php
File metadata and controls
147 lines (127 loc) · 6.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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package cpschool
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'wp_body_open' ); ?>
<div <?php cpschool_class( 'site-page-wrapper', 'site' ); ?> id="page">
<a class="skip-link sr-only sr-only-focusable" href="#content"><?php esc_html_e( 'Skip to content', 'cpschool' ); ?></a>
<?php get_template_part( 'template-parts/global-templates/bar', 'alert' ); ?>
<?php do_action( 'cpschool_site_start' ); ?>
<?php
if( get_theme_mod( 'header_secondary_under_primary' ) == false ) {
get_template_part( 'template-parts/global-templates/navbar', 'secondary' );
}
$header_main_logo_url = cpschool_get_home_url();
?>
<?php // This is used to detect stickness of navigation ?>
<div id="wrapper-navbar-main-top" <?php cpschool_class( 'navbar-main-wrapper-top' ); ?>></div>
<div id="wrapper-navbar-main" <?php cpschool_class( 'navbar-main-wrapper', 'wrapper-navbar' ); ?> itemscope itemtype="http://schema.org/WebSite">
<nav id="navbar-main" <?php cpschool_class( 'navbar-main', 'navbar navbar-expand-md nav-styling-underline has-background has-header-main-bg-color-background-color' ); ?> aria-label="<?php esc_html_e( 'main', 'cpschool' ); ?>">
<div <?php cpschool_class( 'navbar-main-container', 'navbar-container' ); ?>>
<?php do_action( 'cpschool_navbar_main_container_start' ); ?>
<!-- Your site title as branding in the menu -->
<?php if ( ! has_custom_logo() ) { ?>
<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="navbar-brand-holder mb-0 h-style-disable">
<?php else : ?>
<div class="navbar-brand-holder">
<?php endif; ?>
<?php do_action( 'cpschool_navbar_main_logo_text_before' ); ?>
<a <?php cpschool_class( 'navbar-brand', 'navbar-brand logo-font' ); ?> rel="home" href="<?php echo esc_url( $header_main_logo_url ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" itemprop="url">
<span class="navbar-brand-text"><?php bloginfo( 'name' ); ?></span>
<?php if ( ( get_theme_mod( 'header_main_logo_position' ) == 'dropbox' && get_theme_mod( 'header_main_show_tagline' ) ) || is_customize_preview() ) { ?>
<br/><span <?php cpschool_class( 'navbar-brand-subtext', 'navbar-brand-subtext navbar-brand-dropbox-subtext' ); ?>><?php bloginfo( 'description' ); ?></span>
<?php } ?>
</a>
<?php if ( ( get_theme_mod( 'header_main_logo_position' ) != 'dropbox' && get_theme_mod( 'header_main_show_tagline' ) ) || is_customize_preview() ) { ?>
<a rel="home" href="<?php echo esc_url( $header_main_logo_url ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" <?php cpschool_class( 'navbar-brand-subtext', 'navbar-brand-subtext' ); ?>>
<?php bloginfo( 'description' ); ?>
</a>
<?php } ?>
<?php do_action( 'cpschool_navbar_main_logo_text_after' ); ?>
<?php if ( is_front_page() && is_home() ) : ?>
</h1>
<?php else : ?>
</div>
<?php endif; ?>
<?php } else { ?>
<div class="navbar-brand-holder">
<a <?php cpschool_class( 'navbar-brand', 'navbar-brand logo-font' ); ?> rel="home" href="<?php echo esc_url( $header_main_logo_url ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" itemprop="url">
<?php the_custom_logo(); ?>
</a>
</div>
<?php } ?><!-- end custom logo -->
<?php do_action( 'cpschool_navbar_main_after_brand_holder' ); ?>
<div class="navbar-navs-container">
<?php
wp_nav_menu(
array(
'theme_location' => 'desktop',
'container_class' => 'navbar-nav-container',
'container_id' => 'navbar-main-nav-desktop',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => '',
'menu_id' => 'menu-main-desktop',
'depth' => 2,
'walker' => new CPSchool_WP_Bootstrap_Navwalker( true, get_theme_mod( 'nav_hover_dropdowns' ) ),
)
);
?>
<div id="navbar-main-nav-buttons">
<ul class="nav navbar-nav navbar-button-nav-right">
<?php if ( get_theme_mod( 'header_main_enable_search' ) || is_customize_preview() ) { ?>
<li id="navbar-main-btn-search" <?php cpschool_class( 'navbar-main-btn-search' ); ?>>
<button type="button" class="btn btn-secondary nav-link has-styling" data-toggle="modal" data-target="#modal-search">
<i aria-hidden="true" class="cps-icon cps-icon-search"></i>
<span aria-hidden="true" class="d-none"><?php _e( 'Search' ); ?></span>
<span class="sr-only"><?php _e( 'Toggle search interface', 'cpschool' ); ?></span>
</button>
</li>
<?php } ?>
<?php
$btn_slidein_classes = array( 'btn-modal-slide-in-menu-holder' );
if ( has_nav_menu( 'desktop-extended' ) ) {
$btn_slidein_classes[] = 'has-desktop';
}
if ( has_nav_menu( 'desktop' ) || has_nav_menu( 'desktop-extended' ) || has_nav_menu( 'mobile' ) ) {
$btn_slidein_classes[] = 'has-mobile';
}
?>
<li id="navbar-main-btn-slide-in-menu" <?php cpschool_class( 'navbar-main-btn-slide-in', $btn_slidein_classes ); ?>>
<button type="button" class="btn btn-secondary nav-link has-styling" data-toggle="modal" data-target="#modal-slide-in-menu">
<i aria-hidden="true" class="cps-icon cps-icon-menu"></i>
<span aria-hidden="true" class="d-none"><?php _e( 'Menu' ); ?></span>
<span class="sr-only"><?php _e( 'Toggle extended navigation', 'cpschool' ); ?></span>
</button>
</li>
</ul>
</div>
</div>
<?php do_action( 'cpschool_navbar_main_container_end' ); ?>
</div><!-- #navbar-container -->
</nav>
</div><!-- #wrapper-navbar end -->
<?php
if( get_theme_mod( 'header_secondary_under_primary' ) == true ) {
get_template_part( 'template-parts/global-templates/navbar', 'secondary' );
}
?>
<?php
$hero_style = get_theme_mod( 'hero_main_style' );
get_template_part( 'template-parts/global-templates/hero-pagetitle', $hero_style );