header.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 Seedlet
  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', 'sk8prk' ); ?></a>
  24. <header id="masthead" class="site-header wide-max-width">
  25. <?php get_template_part( 'template-parts/header/site-branding' ); ?>
  26. <div class="navigation-container">
  27. <?php if ( has_nav_menu( 'primary' ) ) : ?>
  28. <nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Main Navigation', 'sk8prk' ); ?>">
  29. <button id="toggle-menu" class="button">
  30. <span class="dropdown-icon open"><?php _e( 'Menu', 'sk8prk' ); ?> <?php echo seedlet_get_icon_svg( 'menu_open' ) ?></span>
  31. <span class="dropdown-icon close"><?php _e( 'Close', 'sk8prk' ); ?> <?php echo seedlet_get_icon_svg( 'menu_close' ) ?></span>
  32. <span class="hide-visually expanded-text"><?php _e( 'expanded', 'sk8prk' ); ?></span>
  33. <span class="hide-visually collapsed-text"><?php _e( 'collapsed', 'sk8prk' ); ?></span>
  34. </button>
  35. <?php
  36. // Get menu slug
  37. $location_name = 'primary';
  38. $locations = get_nav_menu_locations();
  39. $menu_id = $locations[ $location_name ];
  40. $menu = wp_get_nav_menu_object( $menu_id );
  41. wp_nav_menu(
  42. array(
  43. 'theme_location' => 'primary',
  44. 'menu_class' => 'main-menu',
  45. 'container_class' => 'main-menu-container menu-'. $menu->slug .'-container',
  46. 'items_wrap' => '<ul id="%1$s" class="%2$s" aria-label="submenu">%3$s</ul>',
  47. )
  48. );
  49. ?>
  50. </nav><!-- #site-navigation -->
  51. <?php endif; ?>
  52. <?php if ( has_nav_menu( 'social' ) ) : ?>
  53. <nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'sk8prk' ); ?>">
  54. <?php
  55. wp_nav_menu(
  56. array(
  57. 'theme_location' => 'social',
  58. 'menu_class' => 'social-links-menu',
  59. 'link_before' => '<span class="screen-reader-text">',
  60. 'link_after' => '</span>' . seedlet_get_icon_svg( 'link' ),
  61. 'depth' => 1,
  62. )
  63. );
  64. ?>
  65. </nav><!-- .social-navigation -->
  66. <?php endif; ?>
  67. </div>
  68. </header><!-- #masthead -->
  69. <div id="content" class="site-content">