header.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 photos
  10. */
  11. ?>
  12. <!doctype html>
  13. <html <?php language_attributes(); ?>>
  14. <head>
  15. <meta charset="<?php bloginfo( 'charset' ); ?>">
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  17. <link rel="profile" href="http://gmpg.org/xfn/11">
  18. <?php wp_head(); ?>
  19. </head>
  20. <body <?php body_class(); ?>>
  21. <div id="page" class="site">
  22. <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'photos' ); ?></a>
  23. <header id="masthead" class="site-header">
  24. <div class="container">
  25. <div class="site-branding">
  26. <?php if ( has_custom_logo() ) : ?>
  27. <div class="site-logo"><?php the_custom_logo(); ?></div>
  28. <?php endif; ?>
  29. <?php
  30. if ( is_front_page() && is_home() ) :
  31. ?>
  32. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  33. <?php
  34. else :
  35. ?>
  36. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  37. <?php
  38. endif;
  39. $photos_description = get_bloginfo( 'description', 'display' );
  40. if ( $photos_description || is_customize_preview() ) :
  41. ?>
  42. <p class="site-description"><?php echo $photos_description; /* WPCS: xss ok. */ ?></p>
  43. <?php endif; ?>
  44. </div><!-- .site-branding -->
  45. <nav id="site-navigation" class="main-navigation">
  46. <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
  47. <?php
  48. echo photos_get_svg( array( 'icon' => 'menu', 'title' => esc_html__( 'Open Menu', 'photos' ) ) ); // WPCS: XSS OK.
  49. echo photos_get_svg( array( 'icon' => 'close-alt', 'title' => esc_html__( 'Close Menu', 'photos' ) ) ); // WPCS: XSS OK.
  50. ?>
  51. <span>
  52. <?php
  53. esc_html_e( 'Menu', 'photos' );
  54. ?>
  55. </span>
  56. </button>
  57. <?php
  58. wp_nav_menu( array(
  59. 'theme_location' => 'menu-1',
  60. 'menu_id' => 'primary-menu',
  61. 'depth' => 4,
  62. ) );
  63. ?>
  64. </nav><!-- #site-navigation -->
  65. </div><!-- .container -->
  66. </header><!-- #masthead -->
  67. <div id="content" class="site-content">
  68. <?php if ( get_header_image() ) : ?>
  69. <div class="header-image">
  70. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php the_header_image_tag(); ?></a>
  71. </div><!-- .header-image -->
  72. <?php endif; ?>