0

I am coding a Wordpress Theme and want to make it translation ready using gettext. Everything works fine except for the $args array of the custom menu.

<?php
    $menu = array(
        'theme_location'  => 'primary',
        'menu'            => '',
        'container'       => 'nav',
        'container_class' => 'menu-container menu-header-container', //former class 'row'
        'container_id'    => 'menu-header-container',
        'menu_class'      => 'menu',
        'menu_id'         => 'menu-header',
        'echo'            => true,
        'fallback_cb'     => 'wp_page_menu',
        'before'          => '',
        'after'           => '',
        'link_before'     => '',
        'link_after'      => '',
        'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>
                            <a href="#menu-header-container" class="toggle-menu-btn show-menu-header-btn"><i class="fa fa-bars"></i> __( "MENÜ", "Template-Theme" )</a>
                            <a href="#top" class="toggle-menu-btn hide-menu-header-btn"><i class="fa fa-times"></i></a>
                            <a href="#top" class="hide-menu-area"></a>',
        'depth'           => 0,
        'walker'          => ''
    );

    wp_nav_menu( $menu ); 
  ?>

The tricky part is in 'items_wrap':

__( "MENÜ", "Template-Theme" )

Unfortunately this doesn't work. The _e() syntax for html doesn't work either.

Does anyone know the proper syntax?

Thanks in advance!

George

george
  • 167
  • 1
  • 4
  • 16

1 Answers1

1

Got it, it has to be like this:

old

<a href="#menu-header-container" class="toggle-menu-btn show-menu-header-btn"><i class="fa fa-bars"></i>&nbsp; __( "MENÜ", "Template-Theme" )</a>

new

<a href="#menu-header-container" class="toggle-menu-btn show-menu-header-btn"><i class="fa fa-bars"></i>&nbsp;'. __( "MENÜ", "Template-Theme" ) .'</a>

Case closed ;-)

george
  • 167
  • 1
  • 4
  • 16