Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: I need to show the same template in both languages, greek and english but only one works. The other shows the default layout of the theme.

Solution: There is a workaround for this issue provided by our specialists. Please follow these steps to apply the workaround:
- Create a full backup of the site.
- Modify elementor-pro/modules/theme-builder/classes/conditions-cache.php Lines 96 - 101:

$query = new \WP_Query( [
            'posts_per_page' => -1,
            'post_type' => Source_Local::CPT,
            'fields' => 'ids',
            'meta_key' => '_elementor_conditions',
        ] );

To:

$query = new \WP_Query( [
            'posts_per_page' => -1,
            'post_type' => Source_Local::CPT,
            'fields' => 'ids',
            'meta_key' => '_elementor_conditions',
            'suppress_filters' => true,
        ] );

- Re-save the Display Conditions for each template.

Could you tell me if the workaround solves the issue?

Important note - This workaround has two effects:
1.- The conditions start working for all languages
2.- When you search for posts or pages etc in the Display Conditions dialog, ALL language posts are returned. This is more of a cosmetic issue but just so you know.

Relevant Documentation:

0% of people find this useful.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 2.11 hours from now. Thank you for your understanding.

This topic contains 7 replies, has 2 voices.

Last updated by Carlos Rojas 3 years, 12 months ago.

Assisted by: Carlos Rojas.

Author Posts
April 2, 2020 at 11:11 am #5821503

nikiforosB

I need to show the same template in both languages, greek and english but only one works. The other shows the default layout of the theme.

I followed documentation from the elementor website about translatin gthe templates and settings the conditions.

You can check this website that it works. Changing languages keeps the same template.
hidden link

And this is the website I ahaving the problem. hidden link

Changing languages changes the template too.

April 2, 2020 at 5:21 pm #5825407

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello,
Thank you for contacting WPML support.

1.- I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to back-up the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

2.- Please increase the PHP Memory Limit. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/
You can add this to wp-config.php to increase WP memory:`

/** Memory Limit */
define('WP_MEMORY_LIMIT', '128M');
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

- Add it above the line /* That's all, stop editing! Happy blogging. */

Kind regards,
Carlos

April 3, 2020 at 1:10 pm #5832251

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello,
Thank you very much for the information provided.

The cause of the issue is that the conditions to display the templates are not being translated correctly. This means that when you create a condition to display a template for archives (as in this case) in the default language it works correctly, however, when you translate this template and set the condition in the secondary language it will overwrite the condition in the default language.

Our compatibility specialists are aware of this issue and they are working on a solution. I have escalated this ticket so they can take a closer look at the issue on your site too.

I will get back to you as soon as I get an answer from them.

Regards,
Carlos

April 3, 2020 at 3:08 pm #5833643

nikiforosB

Hi Carlos, thank you for the reply. I have already contacted with the Elementor team to check this compatibility issue from their side so maybe the solution comes from their part. Anyway, this is a crusial issue between these two plugins and this fix will help us build amazing multilanguage websites.

April 3, 2020 at 3:13 pm #5833661

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi,
Thank you very much for contacting Elementor.

Please let us know if you get an answer from them so I can update our specialists 🙂

Regards,
Carlos

April 20, 2020 at 1:18 pm #5949577

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,

There is a workaround for this issue provided by our specialists. Please follow these steps to apply the workaround:
- Create a full backup of the site.
- Modify elementor-pro/modules/theme-builder/classes/conditions-cache.php Lines 96 - 101:

$query = new \WP_Query( [
			'posts_per_page' => -1,
			'post_type' => Source_Local::CPT,
			'fields' => 'ids',
			'meta_key' => '_elementor_conditions',
		] );

To:

$query = new \WP_Query( [
			'posts_per_page' => -1,
			'post_type' => Source_Local::CPT,
			'fields' => 'ids',
			'meta_key' => '_elementor_conditions',
			'suppress_filters' => true,
		] );

- Re-save the Display Conditions for each template.

Could you tell me if the workaround solves the issue?

Important note - This workaround has two effects:
1.- The conditions start working for all languages
2.- When you search for posts or pages etc in the Display Conditions dialog, ALL language posts are returned. This is more of a cosmetic issue but just so you know.

Regards,
Carlos

April 21, 2020 at 4:04 pm #5961427

nikiforosB

My issue is resolved now. Thank you! I will share the solutuion with the Elementor team to correct the file and release a new update. Many many thanks.

April 21, 2020 at 5:13 pm #5962077

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,
I'm glad to hear that the issue is solved 🙂

Please keep in mind this is a workaround, a final solution should be present in future releases of WPML or Elementor.

Please don't hesitate to contact us if you need our help in the future with WPML. We will be more than happy to help.
Best regards,
Carlos

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.