WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
Polylang - multiple headers (16 posts)

  1. uriman
    Member
    Posted 2 years ago #

    Hi,
    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 ...

    http://wordpress.org/extend/plugins/polylang/

  2. ChowKaiDeng
    Member
    Posted 2 years ago #

    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!

  3. ChowKaiDeng
    Member
    Posted 2 years ago #

    PS: in line 3, replace the "en-US" by the "Locale" code that you have defined for your language.

  4. uriman
    Member
    Posted 2 years ago #

    Hi ChowKaiDeng,
    Thank you very match, your post was very usefull for me :)

    All is working
    Best regards
    uriman

  5. ChowKaiDeng
    Member
    Posted 2 years ago #

    You're welcome! I'm glad it helped.
    Greetings!

  6. andrejs.zelcs
    Member
    Posted 2 years ago #

    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..

  7. ChowKaiDeng
    Member
    Posted 2 years ago #

    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 :)

  8. mountain_spring
    Member
    Posted 1 year ago #

    @ChowKaiDeng, Thanks for this code, you saved me a lot of nerves. ;)

  9. AntonVershinin
    Member
    Posted 1 year ago #

    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?

  10. elenavmolina
    Member
    Posted 1 year ago #

    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

    thanks!

  11. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  12. elenavmolina
    Member
    Posted 1 year ago #

    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...

  13. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I just went back to your site, and now the title appears on both English and Spanish pages.

  14. elenavmolina
    Member
    Posted 1 year ago #

    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... :(

  15. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    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).

  16. elenavmolina
    Member
    Posted 1 year ago #

    Ok. thanks. It works for other Spanish versions but not for Spanish-Spanish (es-ES) version. Ok I will do that.

    Thanks a lot for the help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags