How to dynamically load different footer IDs per language without plugin?

This topic has 13 replies, 3 voices, and was last updated 5 days, 4 hours ago ago by Tony Rodriguez

  • Avatar: Brunos
    Brunos
    Participant
    January 21, 2026 at 11:04

    Hi,
    I’m building a multilingual site (25 languages) using URL prefixes (/fr/, /de/, /es/, etc.) WITHOUT using WPML or Polylang plugins.

    Current Setup
    1 WordPress site with custom routing via .htaccess

    Footer loaded via Static Blocks (Elementor templates)

    All 25 footer static blocks are ALREADY created and translated:

    EN (default): Static Block ID 66718

    FR: Static Block ID 66717

    DE: Static Block ID 66716

    ES: Static Block ID 66715

    IT: Static Block ID 66714

    … (all 25 languages ready)

    Each footer contains translated text, links, and widgets.

    How XStore Currently Loads Footer
    Looking at the database, XStore stores the footer configuration in the et_multiple_headers option with this structure:

    json
    {
    “footer”: {
    “id”: 66718,
    “content_type”: “static_block”,
    “sections”: []
    }
    }
    This hardcodes the English footer (66718) for the entire site.

    The Problem
    ALL languages display the English footer (ID 66718) because it’s configured in Theme Options → Header Builder → Footer.

    When a user visits:

    posterworldwide.com/product/ → Shows footer 66718 ✅ (correct)

    posterworldwide.com/fr/produit/ → Shows footer 66718 ❌ (should be 66717)

    posterworldwide.com/de/produkt/ → Shows footer 66718 ❌ (should be 66716)

    What I Need
    How can I dynamically change which footer Static Block is loaded based on the current language URL?

    Desired behavior:

    text
    URL prefix → Footer Static Block ID
    ———————————–
    / → 66718 (EN)
    /fr/ → 66717 (FR)
    /de/ → 66716 (DE)
    /es/ → 66715 (ES)
    … (25 total)
    What I’ve Tried
    1. Output Buffer HTML Replacement (doesn’t work – footer doesn’t render):

    php
    add_action(‘template_redirect’, function() {
    ob_start(function($html) {
    // Replace data-elementor-id=”66718″ with “66717” for FR
    return str_replace(‘elementor-66718’, ‘elementor-66717’, $html);
    });
    }, 1);
    → Changes the HTML ID but footer content doesn’t display

    2. Elementor Widget Hook (only affects widgets INSIDE footer):

    php
    add_action(‘elementor/frontend/widget/before_render’, function($widget) {
    // This only works for individual widgets, not the footer template itself
    });
    3. Trying to filter et_get_option (doesn’t work):

    php
    add_filter(‘theme_mod_footer’, function($footer) {
    $footer[‘id’] = 66717; // Try to change footer ID
    return $footer;
    });
    → No effect

    Questions for XStore Support
    Which specific XStore filter/hook controls the footer Static Block ID selection?

    Can I intercept et_get_option(‘footer’) to dynamically change the ID before it’s loaded?

    Does XStore cache the et_multiple_headers option? If yes, how can I bypass it per request?

    Is there a recommended way to load different footer Static Blocks per language WITHOUT WPML?

    Should I modify the database option dynamically, or is there a cleaner filter-based approach?

    My Footer Mapping (ready to implement)
    php
    $footer_map = array(
    ‘en’ => 66718,
    ‘fr’ => 66717,
    ‘de’ => 66716,
    ‘es’ => 66715,
    ‘it’ => 66714,
    // … 25 languages total
    );

    $current_lang = ‘fr’; // Detected from URL
    $footer_id = $footer_map[$current_lang];

    // HOW DO I TELL XSTORE TO LOAD THIS FOOTER ID?
    Technical Details
    XStore Theme Version: [insert your version]

    WordPress: 6.4+

    Elementor Pro: [insert your version]

    Server: PHP 8.1+

    Custom multilingual routing via mu-plugin (NO WPML/Polylang)

    All footer Static Blocks are already created, translated, and working individually. I just need to know how to tell XStore to load the correct one based on the URL language prefix.

    Regards

    Content is visible for topic creator and
    support staff only.
    12 Answers
    Avatar: Brunos
    Brunos
    Participant
    January 21, 2026 at 15:46

    Edit :
    Correction – I don’t use Elementor templates and Pro elements

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    January 21, 2026 at 16:28

    Hello @Brunos,

    Could you please provide temporary FTP access? We will check what can be done to help you.

    For FTP access, we require the following details: FTP host, FTP username, FTP password, FTP port, and FTP encryption type. If you need assistance in creating these credentials, please reach out to your hosting provider who will guide you through the process.

    Kind regards, Jack Richardson
    The 8theme’s team

    Avatar: Brunos
    Brunos
    Participant
    January 21, 2026 at 17:41

    Sure.

    Content is visible for topic creator and
    support staff only.
    Avatar: Brunos
    Brunos
    Participant
    January 21, 2026 at 17:46

    Information: you can take the test with the FR language (footer already translated into FR).

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    January 21, 2026 at 19:30

    Hello @Brunos,

    We attempted to upload the footer.php file from the parent theme to your child theme and apply the necessary modifications. Unfortunately, the FTP access you provided does not permit us to upload or modify files. We have attached the error log in the private area.

    Best regards,
    Jack Richardson
    The 8Theme Team

    Content is visible for topic creator and
    support staff only.
    Avatar: Brunos
    Brunos
    Participant
    January 21, 2026 at 20:10

    Yes you are right.
    Can you try now please, I have updated permission

    Regards

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    January 22, 2026 at 07:01

    Hello @Brunos,

    Unfortunately, we still have not had any success. Could you please check whether you can upload the attached file to the xstore-child folder? After that, kindly try to modify any line in the file and attempt to save it.

    Best regards,
    Jack Richardson
    The 8Theme Team

    Content is visible for topic creator and
    support staff only.
    Avatar: Brunos
    Brunos
    Participant
    January 22, 2026 at 07:38

    Hello,
    SFTP Access Fixed ✅

    The permission issue has been resolved. You can now reconnect via SFTP and upload your files (footer.php, etc.) without any restrictions.

    Cause: Unix permissions in chroot SFTP mode were blocking write access. Applied specific ACLs (Access Control Lists) to your user account to allow full modification of the wp-content folder.

    Please reconnect and retry the upload.

    If it still doesn’t work, can you send me the file to upload because I’m not sure you attached the file in your last message.

    Regards

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    January 22, 2026 at 10:24

    Hello @Brunos,

    Thank you for updating the access.

    All improvements should be applied from the file “xstore-child/functions.php” (the modified file), but due to the caching on your website, we cannot yet view the results for testing.

    The list of languages should be updated on your side with the corresponding ID for each language: https://prnt.sc/H-epQY9lxTEn

    Best regards,
    Jack Richardson
    8Theme Team

    Avatar: Brunos
    Brunos
    Participant
    January 22, 2026 at 14:35

    Thank you very much!
    This is perfect!

    Avatar: Brunos
    Brunos
    Participant
    January 22, 2026 at 14:35

    Thanks for the support! My topic “How to dynamically load different footer IDs per language without plugin?” has been successfully resolved.

    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    January 22, 2026 at 14:35

    Dear Brunos,

    We really appreciate your time and engagement within the WordPress & WooCommerce community

    Your feedback drives every improvement we make in XStore — helping us deliver a smoother and more flexible experience with each update.

    Your input makes a real difference.

    Topic closed.
    The 8Theme Team

  • Viewing 13 results - 1 through 13 (of 13 total)

The issue related to '‘How to dynamically load different footer IDs per language without plugin?’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.