-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-header.php
58 lines (41 loc) · 1.44 KB
/
content-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
<?php
/**
* The template for displaying the header area (logo, site title, tagline, primary menu and social menu
*
* @package Patch Lite
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<?php if ( ! is_singular() && ! is_404() && have_posts() ) { echo '<div class="grid__item">'; } ?>
<header id="masthead" class="site-header" role="banner">
<div class="site-branding">
<?php the_custom_logo();
// on the front page and home page we use H1 for the title
echo ( is_front_page() && is_home() ) ? '<h1 class="site-title">' : '<div class="site-title">'; ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<?php bloginfo( 'name' ); ?>
</a>
<?php echo ( is_front_page() && is_home() ) ? '</h1>' : '</div>'; ?>
<?php
$description = get_bloginfo( 'description', 'display' );
if ( $description || is_customize_preview() ) : ?>
<div class="site-description">
<span class="site-description-text"><?php bloginfo( 'description' ); ?></span>
</div>
<?php endif; ?>
</div><!-- .site-branding -->
<nav id="site-navigation" class="main-navigation" role="navigation">
<?php
//the primary menu
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => '',
'menu_class' => 'nav nav--main',
'fallback_cb' => false,
) ); ?>
</nav><!-- #site-navigation -->
</header><!-- #masthead -->
<?php
if ( ! is_singular() && ! is_404() && have_posts() ) { echo '</div>'; }