forked from bootscore/bootscore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
113 lines (86 loc) · 4.09 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
<?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 Bootscore
* @version 6.0.0
*/
// 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">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
<a class="skip-link visually-hidden-focusable" href="#primary"><?php esc_html_e( 'Skip to content', 'bootscore' ); ?></a>
<!-- Top Bar Widget -->
<?php if (is_active_sidebar('top-bar')) : ?>
<?php dynamic_sidebar('top-bar'); ?>
<?php endif; ?>
<header id="masthead" class="<?= apply_filters('bootscore/class/header', 'sticky-top bg-body-tertiary'); ?> site-header">
<nav id="nav-main" class="navbar <?= apply_filters('bootscore/class/header/navbar/breakpoint', 'navbar-expand-lg'); ?>">
<div class="<?= apply_filters('bootscore/class/container', 'container', 'header'); ?>">
<!-- Navbar Brand -->
<a class="navbar-brand" href="<?= esc_url(home_url()); ?>">
<img src="<?= esc_url(apply_filters('bootscore/logo', get_stylesheet_directory_uri() . '/assets/img/logo/logo.svg', 'default')); ?>" alt="<?php bloginfo('name'); ?> Logo" class="d-td-none me-2">
<img src="<?= esc_url(apply_filters('bootscore/logo', get_stylesheet_directory_uri() . '/assets/img/logo/logo-theme-dark.svg', 'theme-dark')); ?>" alt="<?php bloginfo('name'); ?> Logo" class="d-tl-none me-2">
</a>
<!-- Offcanvas Navbar -->
<div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvas-navbar">
<div class="offcanvas-header">
<span class="h5 offcanvas-title"><?= apply_filters('bootscore/offcanvas/navbar/title', __('Menu', 'bootscore')); ?></span>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<!-- Bootstrap 5 Nav Walker Main Menu -->
<?php get_template_part('template-parts/header/main-menu'); ?>
<!-- Top Nav 2 Widget -->
<?php if (is_active_sidebar('top-nav-2')) : ?>
<?php dynamic_sidebar('top-nav-2'); ?>
<?php endif; ?>
</div>
</div>
<div class="header-actions d-flex align-items-center">
<!-- Top Nav Widget -->
<?php if (is_active_sidebar('top-nav')) : ?>
<?php dynamic_sidebar('top-nav'); ?>
<?php endif; ?>
<?php
if (class_exists('WooCommerce')) :
get_template_part('template-parts/header/actions', 'woocommerce');
else :
get_template_part('template-parts/header/actions');
endif;
?>
<!-- Navbar Toggler -->
<button class="<?= apply_filters('bootscore/class/header/button', 'btn btn-outline-secondary', 'nav-toggler'); ?> <?= apply_filters('bootscore/class/header/navbar/toggler/breakpoint', 'd-lg-none'); ?> ms-1 ms-md-2 nav-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvas-navbar" aria-controls="offcanvas-navbar">
<i class="fa-solid fa-bars"></i><span class="visually-hidden-focusable">Menu</span>
</button>
</div><!-- .header-actions -->
</div><!-- .container -->
</nav><!-- .navbar -->
<?php
if (class_exists('WooCommerce')) :
get_template_part('template-parts/header/collapse-search', 'woocommerce');
else :
get_template_part('template-parts/header/collapse-search');
endif;
?>
<!-- Offcanvas User and Cart -->
<?php
if (class_exists('WooCommerce')) :
get_template_part('template-parts/header/offcanvas', 'woocommerce');
endif;
?>
</header><!-- #masthead -->