-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathheader-front.php
More file actions
70 lines (65 loc) · 3.18 KB
/
header-front.php
File metadata and controls
70 lines (65 loc) · 3.18 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<!-- <h3>This is coming from header-front.php</h3> -->
<!-- <p>This will only be used on the front page</p> -->
<?php
$custom_logo = get_theme_mod('custom_logo');
$logo_url = wp_get_attachment_image_url($custom_logo, 'medium');
?>
<nav class="navbar navbar-light justify-content-center header-bg">
<?php if($custom_logo): ?>
<a class="navbar-brand" href="<?= bloginfo('home');?>">
<img src="<?= $logo_url ?>" height="50" alt="">
</a>
<?php else: ?>
<a class="navbar-brand" href="<?= bloginfo('home');?>"><?= bloginfo('name'); ?></a>
<?php endif; ?>
</nav>
<nav class="navbar navbar-expand-md navbar-light header-bg" role="navigation">
<div class="container">
<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>
<!--
Once a menu has been registered in functions.php all we need to do is
tell it where to do.
The wp_nav_menu() function needs an array of values.
The only only value it absolutly needs is the theme_location value, which should
match up with the name of the registered menu.
You need to be careful with styling a menu because by default, all the ID's and classes
for the menu come from the name the user gives it, and we cant control what they name it
so adding in extra parameters like menu_id and styling that will make sure
that the menu looks exactly as it should no mater what the user names it.
https://developer.wordpress.org/reference/functions/wp_nav_menu/
-->
<?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 justify-content-around w-100',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker(),
) );
?>
</div>
</nav>
<?php
if(get_header_image() == false){
$bannerImage = get_template_directory_uri() . '/assets/images/default.jpeg';
} else {
$bannerImage = get_header_image();
}
?>
<?php if(get_header_image()): ?>
<div id="front-page-banner" class="bg-dark" style="background-image: url(<?= $bannerImage; ?>);">
</div>
<?php endif; ?>