Repository navigation
Expand file tree
/
Copy pathheader.php
More file actions
106 lines (92 loc) · 3.42 KB
/
Copy pathheader.php
File metadata and controls
106 lines (92 loc) · 3.42 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
<?php
// =============================================================================
// HEADER.PHP - Site Header
// =============================================================================
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
<header id="masthead" class="site-header" role="banner">
<div class="container">
<!-- h-card and site-branding -->
<div class="site-branding">
<!-- h-card -->
<div class="h-card screen-reader-text">
<?php
$author = get_user_by('email', get_option('admin_email'));
if (!$author) {
$author = get_user_by('ID', 1);
}
if ($author) :
// Get the photo URL
$photo_url = '';
if (has_custom_logo()) {
$custom_logo_id = get_theme_mod('custom_logo');
$logo = wp_get_attachment_image_src($custom_logo_id, 'full');
if ($logo) {
$photo_url = $logo[0];
}
}
if (empty($photo_url)) {
// Fallback to Gravatar
$photo_url = get_avatar_url($author->ID, array('size' => 200));
}
?>
<img src="<?php echo esc_url($photo_url); ?>" alt="<?php echo esc_attr($author->display_name); ?>" class="u-photo" width="200" height="200" />
<span class="p-name">
<a href="<?php echo esc_url(home_url('/')); ?>" class="u-url u-uid" rel="me">
<?php echo esc_html($author->display_name); ?>
</a>
</span>
<?php
$bio = get_the_author_meta('description', $author->ID);
if ($bio) : ?>
<span class="p-note"><?php echo esc_html($bio); ?></span>
<?php endif; ?>
<?php endif; ?>
</div>
<!-- end h-card -->
<!-- Visible branding -->
<?php if (has_custom_logo()) : ?>
<div class="site-logo">
<?php the_custom_logo(); ?>
</div>
<?php endif; ?>
<div class="site-title-wrapper">
<h1 class="site-title">
<a href="<?php echo esc_url(home_url('/')); ?>" rel="home">
<?php bloginfo('name'); ?>
</a>
</h1>
<?php $description = get_bloginfo('description', 'raw'); ?>
<?php if ($description || is_customize_preview()) : ?>
<p class="site-description"><?php echo esc_html($description); ?></p>
<?php endif; ?>
</div>
</div>
<!-- end h-card and site-branding -->
<nav id="site-navigation" class="main-navigation" role="navigation">
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
<span class="menu-icon"></span>
<span class="menu-text"><?php _e('Menu', 'cornerstone'); ?></span>
</button>
<?php
wp_nav_menu(array(
'theme_location' => 'primary',
'menu_id' => 'primary-menu',
'container' => false,
'menu_class' => 'primary-menu',
'fallback_cb' => 'wp_page_menu',
));
?>
</nav>
</div>
</header>