Shopify themes, liquid, logos, and UX
Hi does anyone know how to add a flag icon next to each language in the language selector?
website url is :https://www.almadeportugal.com/
Solved! Go to the solution
This is an accepted solution.
Hi @Ola32 ,
Follow these Steps:
1) Go to Online Store
2) Edit Code
3) Find theme.liquid file
4) Add the following code just above tag </body>
<style>
[data-value="pt-PT"]::before {
content: "";
background-image: url(https://cdn.shopify.com/s/files/1/0419/8504/8729/files/tn_po-flag.gif?v=1711028464);
background-size: cover;
width: 30px;
height: 18px;
display: inline-block;
}
[data-value="en"]::before {
content: "";
background-image: url(https://cdn.shopify.com/s/files/1/0419/8504/8729/files/tn_us-flag.gif?v=1711028458);
background-size: cover;
width: 30px;
height: 18px;
display: inline-block;
}
#HeaderLanguageList a {
display: flex;
align-items: center;
gap: 5px;
line-height: 0.5!important;
justify-content: center;
}
</style>
Result:
If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
Makka
This is an accepted solution.
Hi @Ola32 ,
Follow these Steps:
1) Go to Online Store
2) Edit Code
3) Find theme.liquid file
4) Add the following code just above tag </body>
<style>
[data-value="pt-PT"]::before {
content: "";
background-image: url(https://cdn.shopify.com/s/files/1/0419/8504/8729/files/tn_po-flag.gif?v=1711028464);
background-size: cover;
width: 30px;
height: 18px;
display: inline-block;
}
[data-value="en"]::before {
content: "";
background-image: url(https://cdn.shopify.com/s/files/1/0419/8504/8729/files/tn_us-flag.gif?v=1711028458);
background-size: cover;
width: 30px;
height: 18px;
display: inline-block;
}
#HeaderLanguageList a {
display: flex;
align-items: center;
gap: 5px;
line-height: 0.5!important;
justify-content: center;
}
</style>
Result:
If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
Makka
Hi thanks you so much it worked perfectly , if its not asking to much do you know how to replace the little planet icon with the current selected language (also what is the url for the uk flag if you dont mind sharing)
Hi @Ola32 ,
It is not possible to update it with CSS. We will have to update the base code to make this changes.
There is no such selectors related to language which we can target with CSS.
And to update the flag, you can replace the old code with this new one
<style>
[data-value="pt-PT"]::before {
content: "";
background-image: url(https://cdn.shopify.com/s/files/1/0419/8504/8729/files/tn_po-flag.gif?v=1711028464);
background-size: cover;
width: 30px;
height: 18px;
display: inline-block;
}
[data-value="en"]::before {
content: "";
background-image: url(https://cdn.shopify.com/s/files/1/0419/8504/8729/files/tn_uk-flag.gif?v=1711032088);
background-size: cover;
width: 30px;
height: 18px;
display: inline-block;
}
#HeaderLanguageList a {
display: flex;
align-items: center;
gap: 5px;
line-height: 0.5!important;
justify-content: center;
}
</style>
Hi @Ola32 ,
Use this updated code to change USA flag to UK
<style>
[data-value="pt-PT"]::before {
content: "";
background-image: url(https://cdn.shopify.com/s/files/1/0419/8504/8729/files/tn_po-flag.gif?v=1711028464);
background-size: cover;
width: 30px;
height: 18px;
display: inline-block;
}
[data-value="en"]::before {
content: "";
background-image: url(https://cdn.shopify.com/s/files/1/0419/8504/8729/files/tn_uk-flag.gif?v=1711032088);
background-size: cover;
width: 30px;
height: 18px;
display: inline-block;
}
#HeaderLanguageList a {
display: flex;
align-items: center;
gap: 5px;
line-height: 0.5!important;
justify-content: center;
}
</style>
Thanks so much for the help
Hello, I can't seem to find the code for the Greek flag, could you help me please? Thank you and Merry Christmas!
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024