-
AuthorPosts
-
April 9, 2015 at 6:04 pm #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
CocoApril 10, 2015 at 11:34 pm #426830Hi,
Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
JosueApril 10, 2015 at 11:52 pm #426837This reply has been marked as private.April 11, 2015 at 12:30 am #426851Hey!
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!
JosueApril 14, 2015 at 1:12 pm #428187Thank you Josue!
How can i control the space between EN and DE (will make it smaller)
Regards
CocoApril 14, 2015 at 2:41 pm #428240Hey!
Please add following code to Quick CSS as well
li.custom_switcher a { padding-left: 0; }
Best regards,
YigitApril 14, 2015 at 3:21 pm #428266Thank 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
CocoApril 14, 2015 at 3:35 pm #428270Hey!
Please add following code to Quick CSS
html[lang="en-US"] li.switcher_en a { color: #6692a5!important; }
Cheers!
YigitApril 14, 2015 at 3:50 pm #428278Thank you ;-)
-
AuthorPosts
- The topic ‘WMPL whitout flags – Part 2’ is closed to new replies.