Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #426115

    Hi,

    you have help me nice to make the language-switcher without flags.

    function new_nav_menu_items($items,$args) {
    if (function_exists('icl_get_languages')) {
    $languages = icl_get_languages('skip_missing=0');
    if(1 < count($languages)){
    foreach($languages as $l){
    if(!$l['active']){
    $items = $items.'<li class="menu-item"><a href="'.$l['url'].'">'.$l['native_name'].'</a></li>';
    }
    }
    }
    }
    return $items;
    }
    add_filter( 'wp_nav_menu_items', 'new_nav_menu_items',10,2 );

    AND

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

    AND CSS

    li#menu-item-112 + .menu-item a,li#menu-item-160 + .menu-item a {
      color: blue!important;
    }

    But now i need the switcher with both language names DE / EN
    The active language section will be colored dark gray and the inaktive light grey.
    It is so possible?

    Best Regards
    Coco

    #426830

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #426837
    This reply has been marked as private.
    #426851

    Hey!

    Both lang switchers are now showing, use the following CSS to style them:

    /* Default */
    .custom_switcher a {
        color: red !important;
    }
    
    /* Active */
    html[lang='en-US'] .switcher_en a, html[lang='de-DE'] .switcher_de a{
        color: blue !important;
    }

    Cheers!
    Josue

    #428187

    Thank you Josue!

    How can i control the space between EN and DE (will make it smaller)

    Regards
    Coco

    #428240

    Hey!

    Please add following code to Quick CSS as well

    li.custom_switcher a {
      padding-left: 0;
    }

    Best regards,
    Yigit

    #428266

    Thank you Yigit!

    I’m use additional this code to color the active lanuage – #6692a5 –

    li#menu-item-112 + .menu-item a,li#menu-item-160 + .menu-item a {
    color: #6692a5!important;
    }

    In the english version of my site, that dont will work!
    EN symbol will be grey. What i do wrong?

    Regards
    Coco

    #428270

    Hey!

    Please add following code to Quick CSS

    html[lang="en-US"] li.switcher_en a {
      color: #6692a5!important;
    }

    Cheers!
    Yigit

    #428278

    Thank you ;-)

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘WMPL whitout flags – Part 2’ is closed to new replies.