-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
158 lines (130 loc) · 7.23 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php
/**
* The header.
*
* This is the template that displays all of the <head> section and everything up until main.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package portafolio-theme
*
* @version 0.9.0
* @since 0.9.0
* @author Gerardo Gonzalez
*
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
$container = get_option( '_container' );
$phone = get_option( '_phone_number' );
?>
<!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 understrap_body_attributes(); ?>>
<?php do_action( 'wp_body_open' ); ?>
<div class="site" id="page">
<!-- ******************* The Navbar Area ******************* -->
<header id="wrapper-navbar">
<nav id="main-nav" class="navbar bg-primary">
<h2 id="main-nav-label" class="screen-reader-text">
<?php esc_html_e( 'Main Navigation', 'understrap' ); ?>
</h2>
<div class="<?php echo esc_attr( $container ); ?> justify-content-center">
<div class="row w-100 mw-1200 align-items-center">
<div class="col-sm-6 text-sm-start text-center text-white">
<!-- Your site title as branding in the menu -->
<?php if ( ! has_custom_logo() ) { ?>
<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="navbar-brand mb-0 text-white"><a rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>"
itemprop="url"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<a class="navbar-brand text-white" rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>"
itemprop="url"><?php bloginfo( 'name' ); ?></a>
<?php endif; ?>
<?php
} else {
the_custom_logo();
}
?>
<!-- end custom logo -->
</div>
<div class="col-md-3 col-sm-5 text-center">
<span class="text-white fs-20">
< </span>
<span class="text-white fs-20">
Call me:
</span>
<a href="tel:+52<?php _e($phone, 'understrap'); ?>"
class="text-white fs-20 text-decoration-none">
<?php _e($phone, 'understrap'); ?>
</a>
<span class="text-white fs-20"> /> </span>
</div>
<div class="col-md-3 col-sm-1 text-sm-end text-center">
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas"
data-bs-target="#navbarNavOffcanvas" aria-controls="navbarNavOffcanvas"
aria-expanded="false"
aria-label="<?php esc_attr_e( 'Toggle navigation', 'understrap' ); ?>">
<i class="fa-solid fa-bars fs-32 text-white"></i>
</button>
<div class="offcanvas offcanvas-end bg-transparent backdrop-filter-5" tabindex="-1"
id="navbarNavOffcanvas">
<div class="row vh-100">
<div
class="col-md-8 col-sm-6 bg-primary opacity-75 shadow-right-offcanvas d-flex justify-content-center align-items-center">
<!-- Your site title as branding in the menu -->
<?php if ( ! has_custom_logo() ) { ?>
<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="navbar-brand text-white mb-0"><a rel="home"
href="<?php echo esc_url( home_url( '/' ) ); ?>"
itemprop="url"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<a class="navbar-brand text-white" rel="home"
href="<?php echo esc_url( home_url( '/' ) ); ?>"
itemprop="url"><?php bloginfo( 'name' ); ?></a>
<?php endif; ?>
<?php
} else {
$logo_id = get_theme_mod( 'custom_logo' );
echo wp_get_attachment_image($logo_id, array('600', '300'), "", array( "class" => "img-fluid w-75" ));
}
?>
<!-- end custom logo -->
</div>
<div class="col-md-4 col-sm-6 bg-dark shadow-left-offcanvas">
<div class="offcanvas-header justify-content-end">
<button type="button"
class="btn-close bg-transparent mt-md-100 mt-sm-50 mt-25 mx-auto"
data-bs-dismiss="offcanvas" aria-label="Close">
<i class="fa-solid fa-xmark text-white fs-34"></i>
</button>
</div><!-- .offcanvas-header -->
<!-- The WordPress Menu goes here -->
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'container_class' => 'offcanvas-body text-start',
'container_id' => '',
'menu_class' => 'navbar-nav justify-content-end flex-grow-1 pe-3',
'fallback_cb' => '',
'menu_id' => 'main-menu',
'depth' => 2,
'walker' => new Understrap_WP_Bootstrap_Navwalker(),
)
);
?>
</div>
</div>
</div><!-- .offcanvas -->
</div>
</div>
</div><!-- .container(-fluid) -->
</nav><!-- .site-navigation -->
</header><!-- #wrapper-navbar -->