Skip Navigation

Resolved

Reported for: WPML String Translation 2.7.3

Resolved in: 2.8.5

Overview of the issue

Elementor Pro provides you with the possibility to create your own elements and use them as Global templates on the  Elementor -> My Templates admin page. You create one, translate it using WPML and expect that its translation will be displayed all over your site but it is not the case.

Workaround

Please, before proceeding make a complete backup of your site, files, and database; or only try this workaround on your development site.

First, make sure you that the translation of your Elementor global template has the same type (footer, header… ) than the original one. If this is not the case, please follow these instructions to correctly translate your templates:

  • Go to the Elementor -> My Templates page.
  • Click the Add New button.
  • Select “Footer”, for example.
  • Create a template in the original language.
  • Go to the Elementor Edit Page, choose “Display Conditions” and select “Entire site“, then publish it.
  • Duplicate your Global template from the original language using WPML.
  • Translate it.

Finally, you need to add the following code snippet to your theme’s functions.php file.

Elementor Fix
add_filter( 'elementor/theme/get_location_templates/template_id', 'templated_id' );
function templated_id($theme_template_id){
    if (!is_admin()) {
        $theme_template_id = apply_filters( 'wpml_object_id', $theme_template_id, 'elementor_library', true );
    }
    return $theme_template_id;
}

28 Responses to “Elementor global templates translation are not working”

  1. Hi John,

    It is possible that the translated templates do not have correct Type. Please make sure the Type of template is same as original template. Because as soon as you add the code snippet it starts displaying those translated templates.
    For now, please revert the changes and open a support ticket as Amit said I will check the site myself.

    Thanks

  2. Hi
    This fix did not work.
    It simply toggled off the custom editor in the translated language and readded the “old” and normal footer / header.

    Would love it if there will be a stable fix without having to edit any files.
    Thanks

  3. I have he same problem, my original template is “section” while the translated one is “page”, and I can’t find how to change the template type.

    • Perfect, I see that you are already working with Jose about it and there is a report in our system.
      He will get back to you as soon as there are some news about it.

      Kind regards

  4. Hi WPML
    Please email me when there is an solution for this case.
    I hope it is coding free…
    best regards
    Martin

    • Hello @martinL-50,

      We are still working on a definitive solution and we hope to arrive there soon.
      As soon as it is available we will update the errata.

      Regards,
      Andrés

    • Hello @marinos,

      We are still working on a definitive solution but we hope to arrive soon.
      Thank you for your understanding.

      Regards,
      Andrés

  5. Adding the code did not change a thing. I have Multilingual CMS, String Translation, Translation Management and Media Translation all activated…

  6. Hello,

    At first I couldn’t solve the problem with the provided code because I was pasting it in the wrong place (at the end of the functions.php file) and it wouldn’t work (either didn’t show up, would lose all the formatting or wouldn’t translate at all).

    However, I’m happy to say I have found a solution for my case and since I’ve seen some others still have issues even with the code provided, I think it is for the better to share what I did.

    Well, the code worked fine after I pasted it in what seems to be the right place. Since I was building my theme from scratch with Elementor, it starts with some setup code already on the functions.php file. I am not sure if this only happens when you develop a theme from blank. I have pasted it right at the end of the theme setup (which starts with
    if ( ! function_exists( ‘THEMENAME_setup’), so, after all the “add_theme_support” and before closing the if.

    Also, I’ve then translated all the strings related to the header and footer directly from string translation (not sure if it was needed).

    Last but not least, and probably not totally related to the issue, but related to mine (the landing page header wouldn’t show up at all in the second language, while the header for the rest of the site and footer would show up but always untranslated), all I did was to give it double information to show up on the page. So, on Elementor, in the Display Conditions I picked both the option of displaying it in Front Page and also Singular Page (choose page name there).

    Hope this helps!

  7. Hello everyone,

    We have release a new version WPML 4.0.5 which solves this issue.

    Please, create a full backup of your site and upgrade all your WPML package. Don’t hesitate to open a new ticket in our support forum if your problem remains.

    Regards