« Back to Documentation

Polylang: How To Change The Logo In The Theme For Every Language

If you are using the multi-language Polylang plugin and you want a different logo for every language, in our themes you can do so by simply adding a little coding in the Child Theme. The following guide refers to a website in English and French, but in which of course could be used for different languages as well.

1. Firstly, please make sure that you’re using a Child Theme, it’s the only way to edit the code in our themes.

2. Upload both logo files to the /assets/images folder in the Child Theme. In our case we’ll call the French logo file: logo-fr.png and the English logo: logo-en.png.

3. Go to the functions.php file in the Child Theme, and insert the code below:

Just a little explanation of the code’s logic: What is written here allows to write a list of logos for every language (just as you can add Hebrew, Spanish, etc.). If the current language is unknown then it will select the English logo by default. If the Polylang plugin isn’t active on the site, then the code will not make any changes, and the logo set in the site’s Customizer will be displayed.

If you are using a theme that has a sticky-header with a logo, you’ll probably want the logo name to be changed by the site’s language, so simply add the code below to the functions.php in the Child Theme.

Good Luck!

« Back to Documentation