Add to a Genesis themes functions.php to add a langauge switcher to the Secondary Menu location.
//* WPML Menu Language Switcher to output to genesis secondary menu for 2 languages without showing current language. function new_nav_menu_items($items, $args) { if (function_exists('icl_get_languages') && $args->theme_location == 'secondary' ) { $languages = icl_get_languages('skip_missing=0'); if(1 < count($languages)){ foreach($languages as $l){ if(!$l['active']){ $items = $items.'<li class="menu-item"><a href="'.$l['url'].'">'.$l['native_name'].'</a></li>'; } } } } return $items; } add_filter( 'wp_nav_menu_items', 'new_nav_menu_items',10,2 );
Leave a Reply