Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1298959

    Hi
    I use WPML and the language switcher is text only. My html source code loads three flags I don’t use from ../wp-content/plugins/sitepress-multilingual-cms/res/flags/xx.png. Whats the proper way to get rid of them in the html code?
    Thanks, Filz

    #1299263

    Hey filz51,

    Thank you for the inquiry.

    You are probably looking on the default language switcher from the theme. To remove or disable those flags, please go to the Enfold > Header > Extra Elements and set the Enfold WPML Language Flags ( global setting – used for all languages ) to the second option.

    You can also try this snippet in the functions.php file.

    
    
    //--------------------------------------------------------------
    // Remove Enfold Language Switcher
    //--------------------------------------------------------------
    function avia_remove_main_menu_flags(){
    	global $avia_WPML;
    
    	add_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 9999, 2 );
        remove_filter( 'wp_nav_menu_items', [ 'avia_WPML', 'handler_append_lang_flags' ], 9998, 2 );
    	remove_filter( 'avf_fallback_menu_items', [ 'avia_WPML', 'handler_append_lang_flags' ], 9998, 2 );
    	remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10 );
    	remove_action( 'ava_main_header_sidebar', 'avia_wpml_language_switch', 10 );
    }
    add_action('init','avia_remove_main_menu_flags', 9999);

    Best regards,
    Ismael

    #1299607

    Hi Ismael

    Thank you. Excellent support.

    Happy Tuesday
    Filz

    #1299806

    Hi,

    No problem. Glad we could help. Please feel free to open another thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Remove WPML Flags (png-files) from html source code’ is closed to new replies.