-
AuthorPosts
-
November 4, 2015 at 11:56 am #529911
Hey Guys,
I have the WPML plugin installed on my website and right now I have flags appearing on the top to switch the language. Is it possible to change it to text for example D | E | F instead of the flags?
- This topic was modified 9 years ago by thatkidaathi.
November 4, 2015 at 12:02 pm #529925Hi Arthith!
Please refer to Ismael’s post here – https://kriesi.at/support/topic/wpml-language-selector-in-text-format/#post-527815
Best regards,
YigitNovember 6, 2015 at 10:11 am #531379unfortunately this didn’t answer my question at all. I reposted the question in detail here: https://kriesi.at/support/topic/wpml-language-selector-to-language-code/ hope you guys can help me out
November 9, 2015 at 6:40 am #532374Hi!
You prefer the country code instead of the actual flags. Please refer to this link: https://kriesi.at/support/topic/wpml-customization/#post-352885
Let’s start over. Remove all related modifications then add this code in the functions.php file:
add_action('after_setup_theme','avia_remove_main_menu_flags'); function avia_remove_main_menu_flags(){ remove_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 ); remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 ); remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10); } add_action('init', 'avf_add_flags'); function avf_add_flags() { add_action( 'ava_inside_main_menu', 'avia_wpml_language_switch', 10); }
Use this in the Quick CSS field to remove the flags then set the country code:
/* WPML Flags Country Code */ li.menu-item.menu-item-language.menu-item-language-current.dropdown_ul_available, #header_meta ul.avia_wpml_language_switch.avia_wpml_language_switch_extra,.language_flag img {display: none !important;} .header_color li.language_en.avia_current_lang span.language_code {text-decoration: underline; color: #808080 !important;} .header_color li span.language_code {color: #808080 !important; display: block !important; text-transform: uppercase; font-size: 13px; font-weight: 600; font-family: 'Open Sans', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;} #top ul.avia_wpml_language_switch li {margin: 0; padding: 0 5px; border: none; border-left: 1px solid #808080; height: 14px;} #top ul.avia_wpml_language_switch li:first-child {border-left: none;} #top ul.avia_wpml_language_switch li a {position: relative; top: -12px;} #top ul.avia_wpml_language_switch.avia_wpml_language_switch_extra {position: absolute; top: 38px;} #top .header-scrolled ul.avia_wpml_language_switch.avia_wpml_language_switch_extra {position: absolute; top: 15px;} .avia-menu.av-main-nav-wrap {margin-right: 80px;}
Adjust the values as needed.
Cheers!
IsmaelNovember 9, 2015 at 10:35 am #532452Hey, Thank you so much! Just one thing..right now it doesn’t work on mobile and tablet. how can i make it appear there as well?
November 9, 2015 at 3:28 pm #532635Hi!
Please add following code to Quick CSS in Enfold theme options under General Styling tab
@media only screen and (max-width: 990px) { #header_main_alternate { display: block !important; border: none !important; }}
Best regards,
YigitNovember 9, 2015 at 3:43 pm #532663Thank you very much! Worked perfectly!
-
AuthorPosts
- The topic ‘WPML LANGUAGE SELECTOR FLAG TO TEXT’ is closed to new replies.