header.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 Varia
  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. <div id="page" class="site">
  23. <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'varia' ); ?></a>
  24. <header id="masthead" class="site-header alignfull">
  25. <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
  26. <?php if ( has_nav_menu( 'menu-1' ) ) : ?>
  27. <nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Main Navigation', 'varia' ); ?>">
  28. <input type="checkbox" role="button" aria-haspopup="true" id="toggle" class="hide-visually">
  29. <label for="toggle" id="toggle-menu" class="button">
  30. <?php _e( 'Menu', 'varia' ); ?>
  31. <span class="dropdown-icon open">+</span>
  32. <span class="dropdown-icon close">&times;</span>
  33. <span class="hide-visually expanded-text"><?php _e( 'expanded', 'varia' ); ?></span>
  34. <span class="hide-visually collapsed-text"><?php _e( 'collapsed', 'varia' ); ?></span>
  35. </label>
  36. <?php
  37. wp_nav_menu(
  38. array(
  39. 'theme_location' => 'menu-1',
  40. 'menu_class' => 'main-menu',
  41. 'items_wrap' => '<ul id="%1$s" class="%2$s" aria-label="submenu">%3$s</ul>',
  42. )
  43. );
  44. ?>
  45. </nav><!-- #site-navigation -->
  46. <?php endif; ?>
  47. <?php if ( has_nav_menu( 'social' ) ) : ?>
  48. <nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'varia' ); ?>">
  49. <?php
  50. wp_nav_menu(
  51. array(
  52. 'theme_location' => 'social',
  53. 'menu_class' => 'social-links-menu',
  54. 'link_before' => '<span class="screen-reader-text">',
  55. 'link_after' => '</span>' . varia_get_icon_svg( 'link' ),
  56. 'depth' => 1,
  57. )
  58. );
  59. ?>
  60. </nav><!-- .social-navigation -->
  61. <?php endif; ?>
  62. </header><!-- #masthead -->
  63. <div id="content" class="site-content">