header.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. <?php
  23. if ( function_exists( 'wp_body_open' ) ) {
  24. wp_body_open();
  25. }
  26. ?>
  27. <div id="page" class="site">
  28. <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'varia' ); ?></a>
  29. <?php if ( class_exists( 'A8C\FSE\WP_Template' ) ) : // If the FSE plugin is active, use the Header template for content. ?>
  30. <header id="masthead" class="fse-template-part fse-header entry-content">
  31. <?php
  32. $template = new A8C\FSE\WP_Template();
  33. $template->output_template_content( A8C\FSE\WP_Template::HEADER );
  34. ?>
  35. </header>
  36. <?php else : // Otherwise we'll fallback to the default Varia header below. ?>
  37. <header id="masthead" class="site-header responsive-max-width">
  38. <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
  39. <?php if ( has_nav_menu( 'menu-1' ) ) : ?>
  40. <nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Main Navigation', 'varia' ); ?>">
  41. <input type="checkbox" role="button" aria-haspopup="true" id="toggle" class="hide-visually">
  42. <label for="toggle" id="toggle-menu" class="button">
  43. <?php _e( 'Menu', 'varia' ); ?>
  44. <span class="dropdown-icon open">+</span>
  45. <span class="dropdown-icon close">&times;</span>
  46. <span class="hide-visually expanded-text"><?php _e( 'expanded', 'varia' ); ?></span>
  47. <span class="hide-visually collapsed-text"><?php _e( 'collapsed', 'varia' ); ?></span>
  48. </label>
  49. <?php
  50. wp_nav_menu(
  51. array(
  52. 'theme_location' => 'menu-1',
  53. 'menu_class' => 'main-menu',
  54. 'items_wrap' => '<ul id="%1$s" class="%2$s" aria-label="submenu">%3$s</ul>',
  55. )
  56. );
  57. ?>
  58. </nav><!-- #site-navigation -->
  59. <?php endif; ?>
  60. <?php if ( has_nav_menu( 'social' ) ) : ?>
  61. <nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'varia' ); ?>">
  62. <?php
  63. wp_nav_menu(
  64. array(
  65. 'theme_location' => 'social',
  66. 'menu_class' => 'social-links-menu',
  67. 'link_before' => '<span class="screen-reader-text">',
  68. 'link_after' => '</span>' . varia_get_icon_svg( 'link' ),
  69. 'depth' => 1,
  70. )
  71. );
  72. ?>
  73. </nav><!-- .social-navigation -->
  74. <?php endif; ?>
  75. </header><!-- #masthead -->
  76. <?php endif; ?>
  77. <div id="content" class="site-content">