| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * The header for our theme |
|---|
| 4 | * |
|---|
| 5 | * This is the template that displays all of the <head> section and everything up until <div id="content"> |
|---|
| 6 | * |
|---|
| 7 | * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials |
|---|
| 8 | * |
|---|
| 9 | * @package WordPress |
|---|
| 10 | * @subpackage Twenty_Nineteen |
|---|
| 11 | * @since Twenty Nineteen 1.0 |
|---|
| 12 | */ |
|---|
| 13 | ?><!doctype html> |
|---|
| 14 | <html <?php language_attributes(); ?>> |
|---|
| 15 | <head> |
|---|
| 16 | <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
|---|
| 17 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
|---|
| 18 | <link rel="profile" href="https://gmpg.org/xfn/11" /> |
|---|
| 19 | <?php wp_head(); ?> |
|---|
| 20 | </head> |
|---|
| 21 | |
|---|
| 22 | <body <?php body_class(); ?>> |
|---|
| 23 | <?php wp_body_open(); ?> |
|---|
| 24 | <div id="page" class="site"> |
|---|
| 25 | <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentynineteen' ); ?></a> |
|---|
| 26 | |
|---|
| 27 | <header id="masthead" class="<?php echo is_singular() && twentynineteen_can_show_post_thumbnail() ? 'site-header featured-image' : 'site-header'; ?>"> |
|---|
| 28 | |
|---|
| 29 | <div class="site-branding-container"> |
|---|
| 30 | <?php get_template_part( 'template-parts/header/site', 'branding' ); ?> |
|---|
| 31 | </div><!-- .site-branding-container --> |
|---|
| 32 | |
|---|
| 33 | <?php if ( is_singular() && twentynineteen_can_show_post_thumbnail() ) : ?> |
|---|
| 34 | <div class="site-featured-image"> |
|---|
| 35 | <?php |
|---|
| 36 | twentynineteen_post_thumbnail(); |
|---|
| 37 | the_post(); |
|---|
| 38 | $discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; |
|---|
| 39 | |
|---|
| 40 | $classes = 'entry-header'; |
|---|
| 41 | if ( ! empty( $discussion ) && absint( $discussion->responses ) > 0 ) { |
|---|
| 42 | $classes = 'entry-header has-discussion'; |
|---|
| 43 | } |
|---|
| 44 | ?> |
|---|
| 45 | <div class="<?php echo $classes; ?>"> |
|---|
| 46 | <?php get_template_part( 'template-parts/header/entry', 'header' ); ?> |
|---|
| 47 | </div><!-- .entry-header --> |
|---|
| 48 | <?php rewind_posts(); ?> |
|---|
| 49 | </div> |
|---|
| 50 | <?php endif; ?> |
|---|
| 51 | </header><!-- #masthead --> |
|---|
| 52 | |
|---|
| 53 | <div id="content" class="site-content"> |
|---|