Polylang – multiple headers
I have multilanguage site, and I must implementation different banner (header image) for each language.
How to I use one image for one language and other for another language?
Question:Polylang supports multiple headers? If yes – How to I do that?
Thanks a lot …
Hi! I use this function in any place of my templates where I need to call different contents by language:
<?php $currentlang = get_bloginfo('language'); if($currentlang=="en-US"): ?> <!-- Begin header image for your secondary language. In my case, English is the second language for my site. --> <!-- End here your header image for your secondary language --> <?php else: ?> <!-- Begin here your header image for your main or default language --> <!-- End here your header image for your main or default language --> <?php endif; ?>
Of course, you may use this not just for images, but for any content you need to call in your templates, like sidebar titles in different languages and so on.
I hope this work for you!
PS: in line 3, replace the “en-US” by the “Locale” code that you have defined for your language.
Thank you very match, your post was very usefull for me 🙂
All is working
It looks like I’ve got similar problem, but for you it would be nothing. The first, I’m beginner, I using wordpress 1 month, and I’m member of this forum 2 hours 🙂 And second problem – I’m really bad in english, and it’s hard to read so much specific text.
I made my web pages in 4 languages, all is ok, but I still can’t find where translate home page intro, features content, heading and description. I use ColorWay theme and latest polylang version. Where is it?
Thank’s for help..
Hi andrejs! I’m afraid this method requires a little bit of PHP knowledge, and the Colorway Theme must be modified in order to work in that way with the polylang plugin, but maybe I could help.
First thing: Are you using the WordPress.com server service or do you own an outside hosting provider? I think you must have your WordPress website installed on your own hosting in order to make this changes. If so, please send me an email to chowkaideng-at-gmail.com and I could try to change the theme files and send it back to you.
And, don’t worry, my english is very bad too, and I understand you prefectly 🙂
@chowkaideng, Thanks for this code, you saved me a lot of nerves. 😉
Hi, sorry, do not tell me whether you can use this code to change the header image, depending on the language? Where do you want to insert this code?
hello. I have a similar problem…
But in may case Polylang is hidding the header text and a hidding sidebar in Spanish (default language) dunno why. In secundary language (English) works just fine.
I’m using Brunelleschi theme, and my blog is http://www.porotracuba.org
In your admin dashboard, first activate “all languages” in the languages menu in the admin toolbar on top of your screen.
Then go to settings->languages->strings translation and translate your site title and description. Click on save changes.
Hi! Thanks for the help. I’ve done all that already. Didn’t worked.
Dunno way but I even introduced some words in Header.php on the editor — they apeared in the header of english version but the header of the spanish version remain the same.
Is like it is not reading from header.php or something…
I just went back to your site, and now the title appears on both English and Spanish pages.
Hi! yes i just fix it. I make a trik and change the language to Colombian Spanish and now it works fine. I change it back to Spain-Spanis ans it keeps doing the same weird thing… 🙁
Oh yes, I discovered a big incompatibility between the Brunelleschi theme and multilingual plugins!
The theme uses localized options! For example ‘Text on Top’ is saved on admin side (if your admin is English), but it will look for ‘Texto en cima’ on Spanish frontend. As soon as the theme is fully translated for a language, it breaks on multilingual sites. 🙁
A quick workaround would be to edit the Spanish translation with poedit and remove the translations of the theme options such as ‘Text on Top’ but much better, ask the author to modify his theme to save options values regardless of the language (only what is displayed should be translated, not what is saved in the database).
- The topic ‘Polylang – multiple headers’ is closed to new replies.