I have two menus, but I want to show just on top menu. How can I do that?
]]>Hi,
I just downloaded WPML flag in menu, and it’s great, but the flag is not in the same line as the menu. How can I change this? I am not a html expert, so please write all details that I need, to be able to fix it.
My site is https://www.kalangu.net
Thank you
Eva
Hello!
I much prefer using this plugin because is so simple designed. WPML inbuilt language selector widget is awful.
I have a recent project and I would like to use this plugin to insert the wpml flags with php.
The goal is to insert the flags outside the navigation menu.
Is it possible? with something like this maybe:
<?php plugin_wpml_flag_in_menu();>
In child theme flags are not showing
]]>Hi,
As I’m using an RTL language website,
I added functionality to put the flag at the right side of the menu.
Here is the corrected code,
please update the plugin.
function plugin_wpml_flag_in_menu($items, $args = NULL)
{
if(function_exists('icl_get_languages'))
{
$new_items = '';
$languages = icl_get_languages('skip_missing=0&orderby=code');
if(!empty($languages)){
foreach($languages as $l){
// Exclude current viewing language
if($l['language_code'] != ICL_LANGUAGE_CODE)
{
$new_items .= '<li class="menu-item menu-item-type-post_type menu-item-object-page">';
if(!$l['active']) $new_items .= '<a href="'.$l['url'].'">';
if($l['country_flag_url']){
$new_items .= '<img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" />';
}
// $new_items .= icl_disp_language($l['native_name'], $l['translated_name']);
if(!$l['active']) $new_items .= '</a>';
$new_items .= '</li>';
}
}
}
// Place the flags at the correct side of the menu according to the the language direction
if (is_rtl())
{
$items = $new_items.$items;
} else {
$items .= $new_items;
}
}
return $items;
}
?>
Thank you for a very helpful plugin!
Simon
]]>I found that the flags appear only when using a custom menu.
Please add to the plugins description that you must use a custom menu for the menu to work.
Thank you,
Simon
Hi,
on my play site I installed your plugin but no flags show up.
https://www.play.italianexclusivefurniture.com
please help,
Thanks,
Simon