header.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 1.0.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. <body <?php body_class(); ?>>
  22. <?php wp_body_open(); ?>
  23. <div id="page" class="site">
  24. <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentynineteen' ); ?></a>
  25. <header id="masthead" class="<?php echo is_singular() && twentynineteen_can_show_post_thumbnail() ? 'site-header featured-image' : 'site-header'; ?>">
  26. <div class="site-branding-container">
  27. <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
  28. </div><!-- .site-branding-container -->
  29. <?php if ( is_singular() && twentynineteen_can_show_post_thumbnail() ) : ?>
  30. <div class="site-featured-image">
  31. <?php
  32. twentynineteen_post_thumbnail();
  33. the_post();
  34. $discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null;
  35. $classes = 'entry-header';
  36. if ( ! empty( $discussion ) && absint( $discussion->responses ) > 0 ) {
  37. $classes = 'entry-header has-discussion';
  38. }
  39. ?>
  40. <div class="<?php echo $classes; ?>">
  41. <?php get_template_part( 'template-parts/header/entry', 'header' ); ?>
  42. </div><!-- .entry-header -->
  43. <?php rewind_posts(); ?>
  44. </div>
  45. <?php endif; ?>
  46. </header><!-- #masthead -->
  47. <div id="content" class="site-content">