WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] Multilingual Page as Homepage (8 posts)

  1. ichbinadrian
    Member
    Posted 2 years ago #

    Hi there

    I have WP 3.3.1 and the newest Striking installed. The change between the different languages of a page works perfect, except for the page I defined as homepage.

    Maybe you have a tip:

    http://f-marc.com/11plus/

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

  2. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    I do not understand what is your resquest. Here is what I observed during when browsing your site.

    You have 5 different home pages for 5 different languages. Switching from one to the other seems to work well except that you did not translate the content (which is always in English). So it appears that you have 5 homepages with the same content (even if you assigned them a different language).

    When browsing the English version, I did not find a page which has a translation (maybe some exist but I did not find them).

    It seems also that you use the same menu for all languages so only the English version can be browsed.

    The only translation I found is the tagline (only on the german homepage).

  3. ichbinadrian
    Member
    Posted 2 years ago #

    I now set the homepage to none. Here is the page I had as homepage before:

    http://f-marc.com/11plus/home/

    You'll be able to change the language on that page now. But as soon as I defined it as homepage the url will change but not the content of the page, except for the tagline in german.

    The menus I didn't do yet. Have to figure out how to do that with Striking. I don't use WP usually and I didn't setup this installation either. So I'm just learning.

    Thanks for the fast answer above! Polylang is an awesome plugin from my perspective and you do a great job. Thank you for that as well.

  4. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    OK. Now I understand better what happens. But it's really strange that the theme displays the content of the homepage in English on other pages.

    The fact that you are using a non-free theme will not help as I cannot download it.

    How do you set the page as homepage ? Is it in the Settings->Reading panel or is it in theme options ?

  5. ichbinadrian
    Member
    Posted 2 years ago #

    The theme options or Settings->Reading are interlinked. Changing the homepage will set it on both places. If you provide me with an email, i'll send you a download link to the theme for test purpose (couldn't find one on your profile).

    Thanks alot again. I love coders attitudes.

  6. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    Please post your link here

  7. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    Your theme has been adapted to WPML but not (yet) to Polylang.

    In the file front-page.php (the template loaded to display the front page), we can find a call to the function wpml_get_object_id at line 10.

    This function is defined in the file framework/functions/wpml-integration.php at line 118.

    You can modify this function using the polylang api, adding for example an elseif statement:

    elseif(function_exists('pll_get_post')){
      return pll_get_post($element_id, substr(get_locale(), 0, 2));
    }

    This shows me that I could improve my api by setting the second parameter of pll_get_post to the current language by default.

    Depending on your utilization, you may have to adapt other functionalities of the theme. Probably all needed modifications can be done in the same file.

    As the theme author seems to care about multilingual sites, maybe you can ask him to adapt the plugin to polylang too :)

  8. ichbinadrian
    Member
    Posted 2 years ago #

    Fantastic my friend. The elseif statements works like a charm. I will furthermore contact the theme author with your suggestion.

    Thanks alot! I owe you one.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags