![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
September 26, 2019 at 8:12 pm #1142476
Hi,
Thank you for such a great theme! I’m wondering if you could you please advise on the following?
– How to remove the flags in the language switcher, in the top right corner of the desktop site?
– Make the language switcher text only .. I’m using English and Simplified Chinese; on any English page, to only show the text link for Simplified Chinese, and on a Chinese page, to only show “English” link?
– On a Simplified Chinese page, the sub-directory for the translations appears as “zh-hans/” ; how do I change that subdirectory name, to “ch” for instance?I also reviewed the following thread and tried your advice here, but could not get the language switcher to change to text only:
https://kriesi.at/support/topic/change-flags-to-letters-in-language-switch-wpml/#post-1106424
Since the language I’m using is Simplified Chinese (as opposed to Italian in the thread), I changed the css and added it to Quick CSS for both languages, and also tried it to the custom.css, but nothing changed. I’m not sure if using “zh-hans” as is correct, could you please advise?
____
.noLightbox.social_bookmarks + .sub_menu {
float: right;
}
html[lang=”zh-hans”] .avia_wpml_language_switch li span.language_native {
display: none !important;
}____
Thank you so much for your help, I appreciate your advice!!
October 1, 2019 at 2:27 am #1143535Hey designyvr,
Thank you for the inquiry.
You can use this snippet in the functions.php file to remove the flag switcher and add the default language switcher in the header.
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('ava_main_header', 'ava_icl_language_selector'); function ava_icl_language_selector(){ do_action('icl_language_selector'); }
You can then configure the flag options in the WPML panel.
Related thread: https://kriesi.at/support/topic/wpml-language-switcher-still-not-working/
Best regards,
IsmaelOctober 1, 2019 at 3:50 am #1143553Hi Ismael,
Thanks for you help! I’m not sure why, but adding the code snippet to functions.php added 2 more switchers to my header. I added the CSS from your related thread and then configured the switcher options in the WPML panel, and that did the trick, thanks for the info.
To follow up on one more question from my original post:
On a Simplified Chinese page, the sub-directory for the translations appears as “zh-hans/” ; how do I change that subdirectory name, to “ch” for instance, so the urls for the Chinese pages show domain.com/ch/ instead of domain.com/zh-hans/ ?
Would you be able to advise on that?
Thank you!
October 3, 2019 at 8:00 am #1144377Hi,
Thank you for the update.
We haven’t really tried that before but it is possible according to this thread.
// https://wpml.org/forums/topic/can-i-change-zh-hans-to-zh-or-cn-something/
You will have to create a custom language though. Please contact the plugin developer for additional help.
Best regards,
IsmaelOctober 3, 2019 at 8:12 pm #1144613Hi Ismael, Thank you for sending this link.
-
AuthorPosts
- You must be logged in to reply to this topic.