-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
106 lines (92 loc) · 3.18 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
<?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 Universal
* @subpackage Templates
* @since 1.0.0
* @author Milan Arandjelovic
*/
// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct script access denied.' );
}
$universal_data = get_option( 'universal_data' );
$universal_logo_url = $universal_data['universal__opt-custom-logo']['url'];
$sticky_header = $universal_data['universal__opt-sticky-header'];
$body_classes = '1' === $sticky_header ? ' sticky-header' : '';
?>
<!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="http://gmpg.org/xfn/11">
<title>
<?php
bloginfo( 'name' );
wp_title( '|', true );
?>
</title>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class( $body_classes ); ?>>
<?php do_action( 'universal_before_body_content' ); ?>
<div id="page" class="site">
<div class="top-wrapper">
<?php get_template_part( 'template-parts/header/header-top-bar' ); ?>
<div id="header-wrapper">
<header id="header" class="header">
<nav class="navbar navbar-toggleable-md navbar-light">
<div class="container">
<button
class="navbar-toggler navbar-toggler-right"
type="button" data-toggle="collapse"
data-target="#main-nav"
aria-controls="main-nav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-header">
<div class="logo">
<?php if ( '' !== $universal_logo_url ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="navbar-brand">
<img src="<?php echo esc_url( $universal_logo_url ); ?>"
alt="<?php echo esc_attr( get_bloginfo( 'description' ) ); ?>"
>
</a>
<?php else : ?>
<h1>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="navbar-brand">
<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>
</a>
</h1>
<?php endif; ?>
</div> <!-- /.logo -->
</div> <!-- /.navbar-header -->
<div id="main-nav" class="collapse navbar-collapse">
<?php
wp_nav_menu( array(
'theme_location' => 'universal-primary-menu',
'menu_id' => 'universal-primary-menu',
'container' => '',
'menu_class' => 'navbar-nav ml-auto',
'depth' => 3,
'walker' => new Universal_Menu_Walker(),
'fallback_cb' => 'Universal_Menu_Walker::fallback',
) );
?>
</div> <!-- /.collapse navbar-collapse -->
</div> <!-- /.container -->
</nav> <!-- /.navbar -->
</header> <!-- /#header -->
</div> <!-- /#header-wrapper -->
</div> <!-- /.top-wrapper -->
<div id="content" class="site-content">