header.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 _s
  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. <?php wp_head(); ?>
  18. </head>
  19. <body <?php body_class(); ?>>
  20. <?php wp_body_open(); ?>
  21. <div id="page" class="site">
  22. <a class="skip-link screen-reader-text" href="#primary"><?php esc_html_e( 'Skip to content', '_s' ); ?></a>
  23. <header id="masthead" class="site-header">
  24. <div class="site-branding">
  25. <?php
  26. the_custom_logo();
  27. if ( is_front_page() && is_home() ) :
  28. ?>
  29. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  30. <?php
  31. else :
  32. ?>
  33. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  34. <?php
  35. endif;
  36. $_s_description = get_bloginfo( 'description', 'display' );
  37. if ( $_s_description || is_customize_preview() ) :
  38. ?>
  39. <p class="site-description"><?php echo $_s_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
  40. <?php endif; ?>
  41. </div><!-- .site-branding -->
  42. <nav id="site-navigation" class="main-navigation">
  43. <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', '_s' ); ?></button>
  44. <?php
  45. wp_nav_menu(
  46. array(
  47. 'theme_location' => 'menu-1',
  48. 'menu_id' => 'primary-menu',
  49. )
  50. );
  51. ?>
  52. </nav><!-- #site-navigation -->
  53. </header><!-- #masthead -->