Polylang – different logo for different languages

Polylang doesn’t offer a straightforward way to change logos for different languages.

I managed to use the image set in Dashboard -> Appearance -> Customize -> Site identity + a String translation that points to the image(s) for the alternative language(s).

Polylang’s website offers this tutorial on the topic which I’ve followed step by step. But it wasn’t working.

Here is the working code for Step 2:

<wpml-config>
  <admin-texts>
    <key name='site_logo' />
  </admin-texts>
</wpml-config>

Turns out that (1) the structure should be a bit different and (2) the ‘header_image’ in the database has changed to ‘site_logo’.

Now you can visit Dashboard -> Languages -> String translations and you will see a new string – a number. That’s the ID of the image you’ve set in Site identity -> Logo

To add the alternative image for the other language, upload your logo from the Media panel. Then open the image in the Media Library, click on the address bar if you don’t see the full url – the number in the url is the ID of the image. In my case it was 55, so I set it for the other language.

And Voila, the logo changes when the languages switch.

Be the first to comment

Leave a Reply

Your email address will not be published.


*