Skip Navigation

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

Problem:

If you're experiencing an issue where the Elementor loop is missing on your multilingual site, particularly when comparing different language versions, we have identified a solution.

Solution:

1) Ensure that the translation for the 'Bestseller Loop Home new' template is published in all secondary languages. It might currently be in 'pending for review' mode.
2) Add the following code to the

functions.php

file of your theme, at the bottom:

/**
 * @link wpmlsupp-11444
 */
add_filter( 'elementor/query/query_args', function( $query_args ) {
	$translated_query_args = $query_args;

	if (isset($query_args['tax_query'])) {
		foreach ($query_args['tax_query'] as $key => $query) {
			if (isset($query['field']) && in_array($query['field'], ['term_id', 'term_taxonomy_id'], true)) {
				$query['terms'] = array_map(function( $id ) use ($query){
					return apply_filters( 'wpml_object_id', $id, $query['taxonomy'], TRUE  ); 
				}, (array) $query['terms']);

				$translated_query_args['tax_query'][$key] = $query;
			}
		}
	}

	return $translated_query_args;
}, 100 );

3) Save the changes.
4) Update the page and its translations.

This solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.

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.

Tagged: 

This topic contains 4 replies, has 0 voices.

Last updated by Bigul 3 weeks, 3 days ago.

Assisted by: Bigul.

Author Posts
March 10, 2025 at 4:25 am #16794140

felixS-42

another issue: here is the elementor loop missing

hidden link
hidden link

comparison between german and english page

March 10, 2025 at 4:33 am #16794148

Bigul
Supporter

Languages: English (English )

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

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

This looks like a compatibility issue with Elementor Loop Grid. So I have shared the details with the compatibility developers and waiting for their expert opinion. We will get back to you soon. Please wait.

--
Thanks!

Bigul

March 17, 2025 at 4:31 am #16822850

Bigul
Supporter

Languages: English (English )

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

Hello,

Sorry for the late response. We have a workaround for this compatibility issue. It is working as expected in our local copy and your staging site after the following steps.

1) Publish the translation Bestseller Loop Home new template to all the secondary languages (it was in pending for review mode)
2) Place the following code in functions.php of the theme (on the bottom of the file)

/**
 * @link wpmlsupp-11444
 */
add_filter( 'elementor/query/query_args', function( $query_args ) {
	$translated_query_args = $query_args;

	if (isset($query_args['tax_query'])) {
		foreach ($query_args['tax_query'] as $key => $query) {
			if (isset($query['field']) && in_array($query['field'], ['term_id', 'term_taxonomy_id'], true)) {
				$query['terms'] = array_map(function( $id ) use ($query){
					return apply_filters( 'wpml_object_id', $id, $query['taxonomy'], TRUE  ); 
				}, (array) $query['terms']);

				$translated_query_args['tax_query'][$key] = $query;
			}
		}
	}

	return $translated_query_args;
}, 100 );

3) Save the changes
4) Update the page - hidden link
5) Update the translations

Refer to the following links for more details and let us know your feedback.

hidden link

hidden link

hidden link

--
Thanks!

Bigul

March 18, 2025 at 10:28 am #16829273

felixS-42

will this become part of the next wpml update? so that we avoid having double the code.

March 18, 2025 at 2:17 pm #16830872

Bigul
Supporter

Languages: English (English )

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

Hello,

This bug is happening because of a compatibility conflict between the WPML and the Elementor Pro plugin. So the fix for this bug will be included in the future version of both plugins.

Please use the workaround for the time being. We will get back to you soon when we have an update from the developer about the actual fix. Thank you for your kind understanding.

--
Thanks!

Bigul