Skip Navigation

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

Problem:
On a multilingual website created with Elementor Pro and using WPML, English articles display correctly on the English version of the homepage. However, when using Ajax Pagination or Load More buttons, German articles appear instead of the expected English ones. The issue does not occur on the German version of the site. The client attempted to resolve the issue by adding code to the theme's functions.php file, but it did not resolve the problem, which was later identified as a caching issue.

Solution:
We recommend contacting the theme support to discuss the issue and request their assistance. It's important to ask them to install the theme on a sandbox site to properly debug the issue. If after consulting with the theme support the problem persists, please open a new support ticket with us.

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.

This topic contains 3 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 5 months ago.

Assisted by: Osama Mersal.

Author Posts
November 2, 2023 at 11:19 pm #14721573

saschaA-4

Hi,

On my multilingual website, I created the homepage using Elementor Pro. When I am on the English version of the site, English articles are correctly displayed. However, when I click on the pagination (Ajax Pagination or Load More button), German articles suddenly appear. I am using WPML as the translation plugin, with German set as the default language. I don't have this problem with the German version of the site.

You can see the bug on: hidden link

I already tried to add the following code into our theme functions.php

if (defined('DOING_AJAX') && DOING_AJAX && !empty($_POST['action']) && 'menu-get-metabox' === $_POST['action']) {
    add_action('pre_get_posts', function($query){
         $query->set('suppress_filters', false);
    });
}

But it didn't work.

November 5, 2023 at 9:53 am #14732593

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

First of all, sorry for the late reply due to a higher workload. Please login to this sandbox site and try to replicate the issue. (hidden link)

If the issue is replicable, please let me know how to reproduce it to check it and consult our compatibility team.

Best regards,
Osama

November 5, 2023 at 9:00 pm #14734053

saschaA-4

I've just realized that the issue with the pagination is related to our theme. At least, the pagination works with the standard Elementor post blocks, but not with the extra Elementor blocks (Grid-Block) from our "SmartMag" theme.

Therefore, I can't reproduce the problem on the sandbox site because it lacks the necessary Elementor block.

Do you have any idea what I can do regardless? I will also contact SmartMag support to see if they have a solution.

November 6, 2023 at 7:16 am #14734991

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Please contact the theme support, consult them regarding the issue, and let us know their findings.

Also, please ask them to install the theme on the sandbox site to debug the issue.

Best regards,
Osama

November 9, 2023 at 11:45 am #14765915

saschaA-4

It seems the Code actually worked as intended. There was just a bad caching issue.

Thank you for your time and help!