• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Files / template-parts/modal-menu.php


Lines:

1 to 100 of 150
<?php

/**
 * Displays the menu icon and modal
 *
 * @package WordPress
 * @subpackage Twenty_Twenty
 * @since Twenty Twenty 1.0
 */

?>

<div class="menu-modal cover-modal header-footer-group" data-modal-target-string=".menu-modal">

	<div class="menu-modal-inner modal-inner">

		<div class="menu-wrapper section-inner">

			<div class="menu-top">

				<button class="toggle close-nav-toggle fill-children-current-color" data-toggle-target=".menu-modal" data-toggle-body-class="showing-menu-modal" data-set-focus=".menu-modal">
					<span class="toggle-text"><?php _e( 'Close Menu', 'twentytwenty' ); ?></span>
					<?php twentytwenty_the_theme_svg( 'cross' ); ?>
				</button><!-- .nav-toggle -->

				<?php

        $mobile_menu_location = '';

        // If the mobile menu location is not set, use the primary and expanded locations as fallbacks, in that order.
        if ( has_nav_menu( 'mobile' ) ) {
          $mobile_menu_location = 'mobile';
        } elseif ( has_nav_menu( 'primary' ) ) {
          $mobile_menu_location = 'primary';
        } elseif ( has_nav_menu( 'expanded' ) ) {
          $mobile_menu_location = 'expanded';
        }

        if ( has_nav_menu( 'expanded' ) ) {

          $expanded_nav_classes = '';

          if ( 'expanded' === $mobile_menu_location ) {
            $expanded_nav_classes .= ' mobile-menu';
          }

          ?>

					<nav class="expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>" aria-label="<?php echo esc_attr_x( 'Expanded', 'menu', 'twentytwenty' ); ?>">

						<ul class="modal-menu reset-list-style">
							<?php
              if ( has_nav_menu( 'expanded' ) ) {
                wp_nav_menu(
                  array(
                    'container'      => '',
                    'items_wrap'     => '%3$s',
                    'show_toggles'   => true,
                    'theme_location' => 'expanded',
                  )
                );
              }
              ?>
						</ul>

					</nav>

					<?php
        }

        if ( 'expanded' !== $mobile_menu_location ) {
          ?>

					<nav class="mobile-menu" aria-label="<?php echo esc_attr_x( 'Mobile', 'menu', 'twentytwenty' ); ?>">

						<ul class="modal-menu reset-list-style">

						<?php
            if ( $mobile_menu_location ) {

              wp_nav_menu(
                array(
                  'container'      => '',
                  'items_wrap'     => '%3$s',
                  'show_toggles'   => true,
                  'theme_location' => $mobile_menu_location,
                )
              );

            } else {

              wp_list_pages(
                array(
                  'match_menu_classes' => true,
                  'show_toggles'       => true,
                  'title_li'           => false,
                  'walker'             => new TwentyTwenty_Walker_Page(),
                )
              );

            }
[1] [2] Next »

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      1 to 1 of 1
      • twentytwenty_the_theme_svg() – Output and Get Theme SVG.

      Call hooks

      File name: template-parts/modal-menu.php
      Plugin ref: Twenty Twenty
      Version: 2.0
      Deprecated?: No
      API Letters: M,P,T

      Published: 25th November 2019 | Last updated: 9th June 2022

      Primary Sidebar

      Information

      File name: template-parts/modal-menu.php
      Plugin ref: Twenty Twenty
      Version: 2.0
      Deprecated?: No
      API Letters: M,P,T

      template-parts

      Footer

      WordPress a2z
      WordPress a2z
      WordPress Dynamic API Reference
      WordPress 6.0. PHP: 8.0.20
      WordPress a2z
      WordPress core a2z
      Genesis Theme Framework a2z
      Jetpack a2z
      WordPress develop tests
      Easy Digital Downloads a2z
      WooCommerce a2z
      Yoast SEO a2z
      WordPress Blocks

      Site:  wp-a2z.org
      © Copyright WordPress a2z 2014-2022. All rights reserved.


      Website designed and developed by Herb Miller
      Proudly powered by WordPress and oik plugins

      • Home
      • Blog
      • Sitemap
      • Sites