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

    Hi,

    I installed WPML on top of my Enfold theme and want a country code selector next to my headermenu. Only de country code NL/EN en not the text Dutch/English. I put the following code in functions.php

    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);
    }

    and added the following code to my custom.css

    /* 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;}
    

    It works but now i get both the language selector from WPML and the countrycode selector.
    Screenshot menu
    See private section for the URL to my site.

    What is wrong?
    THX Freek

    • This topic was modified 8 years, 5 months ago by Freek.
    #662783

    ignore

    • This reply was modified 8 years, 5 months ago by mike.rav.
    #663386

    I solved the problem by uncheck the WPML setting show flags in wp-menu.
    THX case closed!
    Freek

    #664130

    Hi,

    Glad you figured it out. Thank you for using Enfold!

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘WPML question’ is closed to new replies.