-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
57 lines (53 loc) · 2.07 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>
<?php
if(is_front_page() == 1) {
echo bloginfo('name');
} else {
echo get_the_title();
}
?>
</title>
<link href="https://fonts.googleapis.com/css?family=Niramit:400,700|Pacifico|Roboto:400,500" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<nav class="navbar navbar-expand-lg navbar-dark " role="navigation">
<div class="container">
<a class="navbar-brand" href="<?= bloginfo('home');?>">
<?php
if (get_theme_mod('navbar_logo_text_setting')) {
echo get_theme_mod('navbar_logo_text_setting');
} else {
echo bloginfo('name');
}
?>
</a>
<?php
wp_nav_menu( array(
'theme_location' => 'header_nav',
'depth' => 2,
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'bs-example-navbar-collapse-1',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker(),
) );
$navText = get_theme_mod('navbar_button_text_setting');
$navlink = get_theme_mod('navbar_button_link_setting');
if ($navText && $navlink):
?>
<div class="form-inline my-2 my-lg-0">
<a class="btn cust-btn my-2 my-sm-0" href="<?= $navlink; ?>" target="_blank"><?= $navText; ?></a>
</div>
<?php endif; ?>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-controls="bs-example-navbar-collapse-1" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>