Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1476234

    Hello,
    I’m having troubles with the header, as I cannot find a way to remove the WPML flag(s) from the menu.
    No demos imported, just created a new menu from scratch.
    Could you please advise?
    Thank you
    Silvia

    #1476280

    Hey Silvia,

    Thank you for the inquiry.

    You can adjust the settings in the Header > Extra Elements > Enfold WPML Language Flags (Global Setting). Or add this code in the functions.php file:

    function avia_remove_main_menu_flags(){
    	global $avia_WPML;
    
    	add_filter( 'wp_nav_menu_items', [ new avia_WPML, 'handler_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);

    IMPORTANT: Please make sure to create a site backup before editing the functions.php file.

    Let us know of the result.

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.