• Hello everyone,

    I’m experiencing an issue with Polylang when trying to display the correct homepage for different languages. Here’s the situation:

    I have two custom templates:

    • front.php for the English homepage
    • inicio.php for the Spanish homepage

    Issue:

    1. When Polylang is enabled, if I set a homepage in the settings, it always loads front.php for both languages, even when I’m visiting the Spanish version of the site.
    2. If I manually create a new page (e.g., called “Inicio”), Polylang automatically links it to front.php, instead of the custom inicio.php template I created for Spanish.
    3. Even when I assign the correct translation for “Home” in English and “Inicio” in Spanish using Polylang’s interface, the system either shows both languages mixed together or loads the incorrect template.

    Steps I’ve taken:

    • I’ve assigned the proper pages in Polylang > Languages > Settings.
    • I’ve verified that both the “Home” (English) and “Inicio” (Spanish) pages are linked as translations of each other.
    • I tried to force template loading using template_redirect and pll_current_language() but either both languages load together, or nothing is displayed.

    What I need:

    • I want front.php to load as the homepage for the English version and inicio.php for the Spanish version, with the correct content displayed for each language.
    • When users select “English” they should see the English homepage, and when they switch to “Espa?ol,” they should see the Spanish homepage, each with their respective content.

    Any suggestions on how to properly load the respective templates for each language without mixing the content or overriding templates?

    Thank you for your help!

  • You must be logged in to reply to this topic.