Nessuna descrizione

site-nav.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Displays the site navigation.
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Twenty_One
  7. * @since Twenty Twenty-One 1.0
  8. */
  9. ?>
  10. <?php if ( has_nav_menu( 'primary' ) ) : ?>
  11. <nav id="site-navigation" class="primary-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary menu', 'twentytwentyone' ); ?>">
  12. <div class="menu-button-container">
  13. <button id="primary-mobile-menu" class="button" aria-controls="primary-menu-list" aria-expanded="false">
  14. <span class="dropdown-icon open"><?php esc_html_e( 'Menu', 'twentytwentyone' ); ?>
  15. <?php echo twenty_twenty_one_get_icon_svg( 'ui', 'menu' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
  16. </span>
  17. <span class="dropdown-icon close"><?php esc_html_e( 'Close', 'twentytwentyone' ); ?>
  18. <?php echo twenty_twenty_one_get_icon_svg( 'ui', 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
  19. </span>
  20. </button><!-- #primary-mobile-menu -->
  21. </div><!-- .menu-button-container -->
  22. <?php
  23. wp_nav_menu(
  24. array(
  25. 'theme_location' => 'primary',
  26. 'menu_class' => 'menu-wrapper',
  27. 'container_class' => 'primary-menu-container',
  28. 'items_wrap' => '<ul id="primary-menu-list" class="%2$s">%3$s</ul>',
  29. 'fallback_cb' => false,
  30. )
  31. );
  32. ?>
  33. </nav><!-- #site-navigation -->
  34. <?php endif; ?>