custom-modern-theme/template-parts/menu/menu-primary.php
2024-07-31 20:14:58 +02:00

68 lines
1.7 KiB
PHP

<?php
/**
* Primary menu template
*
* Accessibility markup applied (ARIA).
*
* @link http://a11yproject.com/patterns/
*
* @package Modern
* @copyright WebMan Design, Oliver Juhas
*
* @since 2.0.0
* @version 2.5.0
*/
$is_mobile_nav_enabled = Modern_Library_Customize::get_theme_mod( 'navigation_mobile' );
?>
<div class="site-header-navigation"><div class="site-header-inner">
<nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'modern' ); ?>">
<?php
if ( $is_mobile_nav_enabled ) :
?>
<button
id="menu-toggle"
class="menu-toggle"
aria-controls="menu-primary"
aria-expanded="false"
><?php
echo esc_html_x( 'Menu', 'Mobile navigation toggle button title.', 'modern' );
?></button>
<?php
endif;
?>
<div id="site-navigation-container" class="main-navigation-container">
<?php
/**
* For `theme_location` see `Modern_Menu::primary_menu_args()` method
* in `includes/frontend/class-menu.php` file.
*/
wp_nav_menu( Modern_Menu::primary_menu_args( $is_mobile_nav_enabled ) );
?>
</div>
<!-- das ist Code, der die Anzeige des Language buttons betrifft und muss ins CHILD Theme verschoben werden -->
<div class="language-switcher">
<div class="language-switcher-link">
<label for="lang_choice_1" class="visuallyhidden">Language selector</label>
<?php
pll_the_languages( array( 'dropdown' => 1, 'display_names_as' => 'slug' ) );
?>
<span class="language-switcher-icon" role="img" aria-label="Language switcher icon"></span>
</div>
</div>
</nav>
</div></div>