header.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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_Seventeen
  11. * @since 1.0
  12. * @version 1.0
  13. */
  14. ?><!DOCTYPE html>
  15. <html <?php language_attributes(); ?> class="no-js no-svg">
  16. <head>
  17. <meta charset="<?php bloginfo( 'charset' ); ?>">
  18. <meta name="viewport" content="width=device-width, initial-scale=1">
  19. <link rel="profile" href="http://gmpg.org/xfn/11">
  20. <?php wp_head(); ?>
  21. </head>
  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', 'twentyseventeen' ); ?></a>
  26. <header id="masthead" class="site-header" role="banner">
  27. <?php get_template_part( 'template-parts/header/header', 'image' ); ?>
  28. <?php if ( has_nav_menu( 'top' ) ) : ?>
  29. <div class="navigation-top">
  30. <div class="wrap">
  31. <?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>
  32. </div><!-- .wrap -->
  33. </div><!-- .navigation-top -->
  34. <?php endif; ?>
  35. </header><!-- #masthead -->
  36. <?php
  37. /*
  38. * If a regular post or page, and not the front page, show the featured image.
  39. * Using get_queried_object_id() here since the $post global may not be set before a call to the_post().
  40. */
  41. if ( ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) && has_post_thumbnail( get_queried_object_id() ) ) :
  42. echo '<div class="single-featured-image-header">';
  43. echo get_the_post_thumbnail( get_queried_object_id(), 'twentyseventeen-featured-image' );
  44. echo '</div><!-- .single-featured-image-header -->';
  45. endif;
  46. ?>
  47. <div class="site-content-contain">
  48. <div id="content" class="site-content">