-
AuthorPosts
-
January 14, 2014 at 11:32 am #209384
Hello,
I would like to have only the flags in my mainmenu, i have sellected the right option in the WPML admin options, but it always show the languages in a drop down list.
I allready read this: https://kriesi.at/support/topic/problem-with-wpml-language-selector/ but it do not help me.
I can’t give you my website URL because it’s under developpement and private but i can give you a simple acces if you want to see it ?I also read this: http://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/ but i would be forced to include some PHP/CSS/HTML code into you theme… :-(
Thanks
PS: please excuse my bad english, i’m not english…
January 14, 2014 at 6:03 pm #209572Hey pako69!
Please post login credentials here privately. Make sure to check “Set as private reply (Only you and moderators will see the content of this post)” above Submit button
Regards,
YigitJanuary 14, 2014 at 7:44 pm #209647This reply has been marked as private.January 15, 2014 at 8:43 am #209913Hey!
I added the flags to the main menu. I had to insert following code at the bottom of functions.php
if(!function_exists('avia_append_lang_flags')) { //first append search item to main menu add_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 10, 2 ); function avia_append_lang_flags( $items, $args ) { if ((is_object($args) && $args->theme_location == 'avia')) { global $avia_config; global $sitepress; $languages = icl_get_languages('skip_missing=0&orderby=custom'); if(is_array($languages)) { foreach($languages as $lang) { $currentlang = (ICL_LANGUAGE_CODE == $lang['language_code']) ? 'avia_current_lang' : ''; if(is_home() || is_front_page()) $lang['url'] = $sitepress->language_url($lang['language_code']); $items .= "<li class='language_".$lang['language_code']." $currentlang'><a href='".$lang['url']."'>"; $items .= " <span class='language_flag'><img title='".$lang['native_name']."' src='".$lang['country_flag_url']."' /></span>"; $items .= "</a></li>"; } } } return $items; } }
Cheers!
PeterJanuary 15, 2014 at 8:58 am #209919hey :-) Thank you
But as you can see, i have two language switcher: one append to the mainmenu and one near the phone number.
I havn’t choose yet the one i want to keep, but can you explain me how to disable the one near the phont number?
ThanksJanuary 15, 2014 at 9:29 am #209934Hey!
You can disable it using this on Quick CSS:
#header_meta .avia_wpml_language_switch { display: none; }
Regards,
IsmaelJanuary 15, 2014 at 9:30 am #209936Hi!
Yes, insert following code into the functions.php file
add_action('init','avia_remove_default_lang_menu', 10); function avia_remove_default_lang_menu(){ remove_action( 'avia_meta_header', 'avia_wpml_language_switch' ); }
Cheers!
PeterJanuary 15, 2014 at 9:47 am #209944PHP… CSS … hum…
Well, it do not matter: it works
thanks -
AuthorPosts
- The topic ‘Horizontal WPML Language switcher apend to the main menu’ is closed to new replies.