-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
58 lines (51 loc) · 2.67 KB
/
header.php
File metadata and controls
58 lines (51 loc) · 2.67 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
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<!-- meta -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!-- fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&family=Roboto+Serif:opsz,wght@8..144,100..900&display=swap" >
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
<!-- css -->
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/assets/css/style.css?v=<?php echo time(); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php
// Get header settings
$topbar_enabled = get_field('topbar_enabled', 'option');
if ($topbar_enabled === null) {
$topbar_enabled = true; // Default to enabled
}
$topbar_text = get_field('topbar_text', 'option');
if (empty($topbar_text) && $topbar_enabled) {
$topbar_text = 'We are privately owned and not affiliated or endorsed by any government agency.';
}
$cta_button = get_field('cta_button', 'option');
// Default CTA if not set
$cta_url = !empty($cta_button['url']) ? $cta_button['url'] : '/get-started/';
$cta_text = !empty($cta_button['title']) ? $cta_button['title'] : 'Get Started';
$cta_target = !empty($cta_button['target']) ? $cta_button['target'] : '_self';
?>
<?php if ($topbar_enabled && !empty($topbar_text)): ?>
<section class="top-bar">
<div class="c">
<p><?php echo esc_html($topbar_text); ?></p>
</div><!-- c -->
</section><!-- top-bar -->
<?php endif; ?>
<header>
<div class="c">
<a class="logo" href="<?= get_home_url(); ?>">
<?= wp_get_attachment_image(get_field('logo', 'option'), 'full'); ?>
<span class="nav-back">Back</span>
</a><!-- logo -->
<?php get_template_part('template-parts/sections/nav'); ?>
<a class="header-cta" href="<?php echo esc_url($cta_url); ?>" target="<?php echo esc_attr($cta_target); ?>"><?php echo esc_html($cta_text); ?></a>
<span class="toggle-menu"></span>
</div><!-- c -->
</header>