-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
213 lines (182 loc) · 8.4 KB
/
header.php
File metadata and controls
213 lines (182 loc) · 8.4 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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6F365PNSMS"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-6F365PNSMS');
</script>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<a href="#content" class="sr-only focus:not-sr-only"><?php _e('Skip to content', 'portfolio') ?></a>
<header class="site-heading">
<nav class="site-heading-container">
<a href="<?php echo home_url(); ?>" class="site-branding">
<?php echo get_bloginfo( 'name' ); ?>
</a>
<div class="flex items-center md:order-2">
<?php if ( get_field('call_to_action_button_text', 'option') ) : ?>
<a href="<?php echo esc_attr( get_field('call_to_action_button_url', 'option') ); ?>" class="primary-button"> <?php echo get_field('call_to_action_button_text', 'option'); ?>
</a>
<?php endif; ?>
<button data-collapse-toggle="menu-container" type="button" class="open-menu-button" aria-controls="mobile-menu-2" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path></svg>
<svg class="hidden w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
</button>
</div>
<?php wp_nav_menu(
array(
'container_id' => 'menu-container',
'container_class' => 'items-center justify-between hidden w-full md:flex md:w-auto md:order-1',
'menu_class' => 'primary-menu',
'theme_location' => 'primary',
'li_class' => '',
'fallback_cb' => false,
)
); ?>
</nav>
</header>
<?php if ( is_page() && !is_page('home') || is_404() ) { ?>
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) :
the_post();
?>
<div class="mt-5 hero">
<div class="hero-container">
<h1>
<div class="text-center"><?php the_title(); ?></div>
<?php if ( is_single() ) { ?>
<time datetime="<?php echo get_the_date( 'c' ); ?>" itemprop="datePublished" class="text-sm text-gray-700"><?php echo get_the_date(); ?></time>
<?php } ?>
</h1>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php } ?>
<?php if ( is_archive() ) { ?>
<div class="mt-5 hero">
<div class="hero-container">
<h1>
<?php the_archive_title(); ?>
</h1>
<?php if ( is_archive() ) { ?>
<div class="text-center">
<span class="text-sm font-normal normal text-slate-500"><?php _e('Last post in category made ','portfolio') ?></span><time datetime="<?php echo get_the_date( 'c' ); ?>" itemprop="datePublished" class="text-sm font-normal text-gray-700"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago.' ?></time>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php if ( is_single() ) { ?>
<div class="mt-5 hero">
<div class="hero-container">
<h1>
<div class="text-center"><?php the_title(); ?></div>
</h1>
<?php if ( is_single() ) { ?>
<div class="text-center">
<?php
$output = '<span class="text-sm">Posted in ';
$categories = get_the_category();
if ($categories){
foreach($categories as $category) {
$output .= '<span class="mr-2 px-3 py-2 lg:mx-0; text-sm font-medium text-white bg-indigo-900 rounded-full dark:bg-gray-700" style="width: max-content"><a href="' . esc_attr( esc_url( get_category_link( $category->term_id ) ) ) . '">' . $category->name . '</a></span>';
}
echo trim($output);
}
?>
<span class="text-sm font-normal text-slate-500"></span><span class="text-sm"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?></span></span>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
`
<?php if ( is_front_page() ) { ?>
<div class="hero">
<div class="home-hero-container">
<div class="flex flex-col items-center justify-between bg-white md:flex-row">
<div class="w-full p-5 mx-auto md:w-1/2">
<h1 class="text-xl font-extrabold leading-tight tracking-tight uppercase md:text-3xl lg:text-5xl dark:text-white">
<?php if ( get_field('hero_tagline') ) : ?>
<span class="text-3xl md:text-4xl lg:text-6xl text-gradient">
<?php echo get_field('hero_tagline'); ?>
</span>
<?php endif; ?>
<?php if ( get_field('hero_subheading') ) : ?>
<span class="font-thin"><?php echo get_field('hero_subheading'); ?></span>
<?php endif; ?>
</h1>
<?php if ( get_field('hero_text') ) : ?>
<p class="text-base font-normal text-gray-500 sm:text-xl dark:text-gray-400">
<?php echo get_field('hero_text'); ?>
</p>
<?php endif; ?>
<div class="social-links">
<a href="https://www.linkedin.com/in/matthummel-va/" aria-label="LinkedIn">
<ion-icon name="logo-linkedin"></ion-icon>
</a>
<a href="https://github.com/matthummeldev" aria-label="Twitter">
<ion-icon name="logo-github"></ion-icon>
</a>
</div>
</div>
<div class="mt-10 lg:mt-0 w/-1/4">
<?php
$custom_logo_id = get_theme_mod('custom_logo');
$logo = wp_get_attachment_image_src($custom_logo_id , 'full');
?>
<?php echo '<img src="'. esc_url($logo[0]) .'" alt="'. get_bloginfo('name') .'" class="w-auto h-auto mx-auto md:mx-0 filter grayscale">'; ?>
</div>
</div>
<div class="mt-10">
<?php if ( get_field('what_i_do_heading', 'option') ) : ?>
<h2> <?php echo get_field('what_i_do_heading', 'option'); ?></h2>
<?php endif; ?>
<div class="grid w-full gap-5 lg:grid-cols-3">
<?php if ( get_field('what_col_1_heading', 'option') ) : ?>
<div class="hero-box">
<h3 class="mt-0 "><?php echo get_field('what_col_1_heading', 'option'); ?></h3>
<p><?php echo get_field('what_col_1_description', 'option'); ?></p>
</div>
<?php endif; ?>
<?php if ( get_field('what_col_1_heading', 'option') ) : ?>
<div class="hero-box">
<h3 class="mt-0 "><?php echo get_field('what_col_2_heading', 'option'); ?></h3>
<p><?php echo get_field('what_col_2_description', 'option'); ?></p>
</div>
<?php endif; ?>
<?php if ( get_field('what_col_3_heading', 'option') ) : ?>
<div class="hero-box">
<h3 class="mt-0 "><?php echo get_field('what_col_3_heading', 'option'); ?></h3>
<p><?php echo get_field('what_col_3_description', 'option'); ?></p>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<main id="content">