mirror of
https://github.com/woocommerce/storefront.git
synced 2025-08-20 04:00:29 +08:00
Fix mobile nav menu in AMP Standard by using nav_menu_toggle
(#1992)
This commit is contained in:
parent
143f4a570e
commit
32bb2c33ae
2 changed files with 13 additions and 1 deletions
|
@ -235,6 +235,18 @@ if ( ! class_exists( 'Storefront' ) ) :
|
|||
* Add support for responsive embedded content.
|
||||
*/
|
||||
add_theme_support( 'responsive-embeds' );
|
||||
|
||||
add_theme_support(
|
||||
'amp',
|
||||
array(
|
||||
'nav_menu_toggle' => array(
|
||||
'nav_container_id' => 'site-navigation',
|
||||
'nav_container_toggle_class' => 'toggled',
|
||||
'menu_button_id' => 'site-navigation-menu-toggle',
|
||||
'menu_button_toggle_class' => 'toggled',
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -239,7 +239,7 @@ if ( ! function_exists( 'storefront_primary_navigation' ) ) {
|
|||
function storefront_primary_navigation() {
|
||||
?>
|
||||
<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Navigation', 'storefront' ); ?>">
|
||||
<button class="menu-toggle" aria-controls="site-navigation" aria-expanded="false"><span><?php echo esc_html( apply_filters( 'storefront_menu_toggle_text', __( 'Menu', 'storefront' ) ) ); ?></span></button>
|
||||
<button id="site-navigation-menu-toggle" class="menu-toggle" aria-controls="site-navigation" aria-expanded="false"><span><?php echo esc_html( apply_filters( 'storefront_menu_toggle_text', __( 'Menu', 'storefront' ) ) ); ?></span></button>
|
||||
<?php
|
||||
wp_nav_menu(
|
||||
array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue