This repository was archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheader.php
More file actions
120 lines (94 loc) · 2.69 KB
/
header.php
File metadata and controls
120 lines (94 loc) · 2.69 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
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
<!DOCTYPE html>
<html <?= get_language_attributes() ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>"/>
<meta name="viewport" content="width=device-width"/>
<title><?php wp_title('|', true, 'right') ?><?= get_option('blogname') ?></title>
<link rel="profile" href="https://gmpg.org/xfn/11"/>
<link rel="pingback" href="<?php echo esc_url(get_bloginfo('pingback_url')); ?>">
<link rel="stylesheet" href="<?php echo get_template_directory_uri() . '/style.css'; ?>">
<link rel="profile" href="https://gmpg.org/xfn/11"/>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<style>
.header-nav {
display: flex;
flex-flow: column;
}
.header-nav > :first-child {
flex: 0 0 50%;
}
@media (min-width: 768px) {
.header-nav {
justify-content: space-between;
align-items: center;
flex-flow: row;
}
}
</style>
<nav class="container header-nav">
<div>
<a href="<?php echo get_home_url() ?>" style="font-size: 2.5rem; color: #fff"><?= get_bloginfo('name') ?></a>
<p style="margin: 0"><?= get_bloginfo('description') ?></p>
</div>
<style>
#menu_gorne ul {
padding: 0;
list-style: none;
display: flex;
gap: 2rem;
}
</style>
<?php
wp_nav_menu(array(
'theme_location' => 'main-menu',
'fallback_cb' => '__return_false',
'container_id' => 'menu_gorne',
'depth' => 0,
));
?>
</nav>
<?php
$title = '';
if (is_page()):
$title = get_the_title();
elseif (is_category()):
$title = get_cat_name(get_queried_object_id());
elseif (is_tag()):
$title = get_tag(get_queried_object_id())->name;
endif;
$description = '';
if (is_category() && category_description()):
$description = category_description();
elseif (is_tag() && tag_description()):
$description = tag_description();
endif;
$show_jumbo = $title !== '' || $description !== '' || is_search() || is_home();
?>
<?php if ($show_jumbo): ?>
<style>
#jumbo {
padding-top: 120px;
padding-bottom: 120px;
position: relative;
}
#jumbo:empty {
display: none;
}
#jumbo > h1 {
text-align: center;
}
</style>
<div id="jumbo" class="container">
<?php if ($title !== ''): ?>
<h1><?= $title ?></h1>
<?php endif; ?>
<?php if ($description !== ''): ?>
<div><?= $description ?></div>
<?php endif; ?>
<?php if (is_search() || is_home()): ?>
<?= get_search_form() ?>
<?php endif; ?>
</div>
<?php endif; ?>