).
*
* @since 3.0.0
* @var Array
*/
$menu_classes = apply_filters( 'astra_primary_menu_classes', array( 'main-header-menu', 'ast-nav-menu', 'ast-flex', $submenu_class, $stack_on_mobile_class ) );
$items_wrap = ' 'site-navigation',
'class' => 'ast-flex-grow-1 navigation-accessibility site-header-focus-item',
'aria-label' => esc_attr__( 'Site Navigation', 'astra' ),
)
);
$items_wrap .= '>';
$items_wrap .= '';
$items_wrap .= '
';
$items_wrap .= '
';
$items_wrap .= ' ';
// Fallback Menu if primary menu not set.
$fallback_menu_args = array(
'theme_location' => $theme_location,
'menu_id' => 'ast-hf-mobile-menu',
'menu_class' => 'main-navigation',
'container' => 'div',
'before' => '
',
'walker' => new Astra_Walker_Page(),
);
// To add default alignment for navigation which can be added through any third party plugin.
// Do not add any CSS from theme except header alignment.
echo '';
if ( is_customize_preview() ) {
Astra_Builder_UI_Controller::render_customizer_edit_button();
}
if ( has_nav_menu( $theme_location ) ) {
wp_nav_menu(
array(
'menu_id' => 'ast-hf-mobile-menu',
'menu_class' => esc_attr( implode( ' ', $menu_classes ) ),
'container' => 'div',
'container_class' => 'main-header-bar-navigation',
'items_wrap' => $items_wrap,
'theme_location' => $theme_location,
)
);
} else {
echo '
';
echo ' 'site-navigation',
)
);
echo ' class="ast-flex-grow-1 navigation-accessibility" aria-label="' . esc_attr__( 'Site Navigation', 'astra' ) . '">';
wp_page_menu( $fallback_menu_args );
echo ' ';
echo '
';
}
echo '
';
}
}
/**
* Kicking this off by creating an object.
*/
new Astra_Mobile_Menu_Component();