This repository has been archived by the owner on Dec 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
72 lines (55 loc) · 1.56 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
<?php
/**
* Header for tm.id.au WordPress theme.
*
* @author Tim Malone <[email protected]>
*/
$site_image_field = get_field( 'site_image', 'options' );
if ( $site_image_field ) {
$image_source = $site_image_field['sizes']['thumbnail'];
$alt_text = tm_get_alt_text( $site_image_field );
$site_image = '<img src="' . $image_source . '" alt="' . $alt_text . '" />';
}
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<?php wp_head(); ?>
<meta name="viewport" content="width=device-width" />
</head>
<body <?php body_class(); ?> style="opacity: 0;">
<?php tm_add_google_tag_manager_body(); ?>
<div class="page-wrapper">
<header>
<figure class="logo">
<?php if ( is_front_page() && ! is_paged() ) { ?>
<h1 class="site-heading">
<?php
if ( isset( $site_image ) ) {
echo $site_image;
}
bloginfo();
?>
</h1>
<?php } else { ?>
<div class="site-heading">
<a href="<?php echo home_url(); ?>">
<?php
if ( isset( $site_image ) ) {
echo $site_image;
}
bloginfo();
?>
</a>
</div>
<?php } ?>
</figure> <!-- .logo -->
<nav>
<?php
wp_nav_menu([
'theme_location' => 'main-menu',
]);
?>
</nav>
<?php dynamic_sidebar( 'header' ); ?>
</header>
<main>