Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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?

    Screenshot

    • This topic was modified 8 years, 5 months ago by thatkidaathi.
    #529925

    Hi Arthith!

    Please refer to Ismael’s post here – https://kriesi.at/support/topic/wpml-language-selector-in-text-format/#post-527815

    Best regards,
    Yigit

    #531379

    unfortunately 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

    #532374

    Hi!

    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!
    Ismael

    #532452

    Hey, 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?

    #532635

    Hi!

    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,
    Yigit

    #532663

    Thank you very much! Worked perfectly!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘WPML LANGUAGE SELECTOR FLAG TO TEXT’ is closed to new replies.