Hi @manudeoli,
I took an in depth look on the matter and I came to realize that the customizer field where you are adding shortcode has been sanitized (in layman’s terms – only text will appear) so the shortcode won’t work. I recommend you to use the other option provided by the plugin such as adding the language switcher on Menu item or Floating language which is working perfectly.
Thanks and regards,
Milan.
Hi Milan,
Thanks a lot for your answer.
It’s a shame because my client would like to see this feature in top bar. Isn’t there a solution to prevent code cleanup? It’s amazing because in the theme customization editor, there is the button to add the shortcode, but when I click on it, nothing happens…
Hi @manudeoli,
I implemented the language switcher in the top bar and it looks like this. To achieve this, first you have to create a child theme, if you don’t have an idea about it then please go through this link https://themegrill.com/blog/tutorial-creating-wordpress-child-theme/.
Now that you have a child theme, create header.php file and copy the code from the parent theme. If you are a developer it won’t be hard for you to locate the place to insert the shortcode if you aren’t, then add the shortcode code after a line that says ‘endif; // woocommerce check’ that should do the trick. The code you should insert is echo do_shortcode( '[language-switcher]' ); .
Thanks and regards,
Milan
-
This reply was modified 5 years, 11 months ago by
Milan Thapa.
-
This reply was modified 5 years, 11 months ago by
Milan Thapa.
Hi Milan,
It works perfect, thank you very much !