Archived topic
Language Switcher (Flag)
5 replies · Started by Andreas on February 4, 2021
Hello to all!
Im using gneratepress and all is fine:-)
But I am searching for a language switcher, i.e. an English flag with a link from my german site to the English page. From here https://hairforlife.info to https://www.hairforlife-international.com.
As you can see, I have already inserted a flag via the custom menu. Everything is great!
But: You can't see the English flag on the mobile version, only then if you click on menu and you scroll down, a bit suboptimal I think.
I thought I'd put the flag above the header in the middle, or below the header. Is that possible, i.e. with a "link" to the English page? Do you have a tip?
Man thanks for helping:-)!
Hi Andreas,
You could use a hook element to add the flag:
https://docs.generatepress.com/article/hooks-element-overview/
The content of the hook would be the image with the English language link, choose generate_menu_bar_itemas hook, choose entire site as location in display rules.
You might need some CSS to give it a finish look, we'll be happy with that once the layout is done.
Let me know :)
Good day!
Thank you sooo much!
I tried a hook, but with „block“ and then generate_menu-bar-item. Its working (check https://www.hairforlife.info, but I think the location from the flag ist not exactly in the middle. Any idea how I can make it better?
P.s. The problem is that I am not experienced with CSS, I am not a programmer.
Hi there,
add this CSS to your site:
.menu-bar-items .wp-block-image {
margin-bottom: 0;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Very cool David. Thank you soooo much!
Glad to be of help.