Skip Navigation

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

Problem:

The client reported that the 'Post' category in some widgets was not translating correctly.

Solution:

After testing, we found a workaround that involves modifying the code in the Elementor plugin. Here are the steps we recommend you follow after making a full site backup:

  1. Navigate to the
    wp-content/plugins/ultimate-elementor/modules/posts/template-blocks/

    folder.

  2. Open the
    skin-style.php

    file for editing.

  3. Scroll to line 1088 and replace the existing code with the following:


    From

    $filter_type = $settings[ $filter_by . '_' . $post_type . '_filter_rule' ];
     
    $filters = $settings[ 'tax_' . $filter_by . '_' . $post_type . '_filter' ];
    

    To

    $filter_type = $settings[ $filter_by . '_' . $post_type . '_filter_rule' ];
     
    // WPML Workaround for compsupp-7728
    if (class_exists('Sitepress')) {
        $original_terms = $settings[ 'tax_' . $filter_by  . '_' . $post_type . '_filter' ];
        $translated_terms = [];
     
        foreach ($original_terms as $term_slug) {
            $term_obj = get_term_by('slug', $term_slug, $filter_by );
             
            if ($term_obj) {
                $translated_term_id = apply_filters('wpml_object_id', $term_obj->term_id, $filter_by , true);
                $translated_term = get_term($translated_term_id, $filter_by );
                if ($translated_term && !is_wp_error($translated_term)) {
                    $translated_terms[] = $translated_term->slug;
                }
            }
        }
     
        $settings[ 'tax_' . $filter_by  . '_' . $post_type . '_filter' ] = $translated_terms;           
    }
     
    $filters = $settings[ 'tax_' . $filter_by . '_' . $post_type . '_filter' ];
    

Additionally, the plugin author has included a fix in the upcoming version of Ultimate Addons for Elementor, which we have already implemented in our sandbox site for testing.

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your 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 further assistance is needed, please open a new support ticket at WPML support forum.

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 13 replies, has 1 voice.

Last updated by Bigul 1 week, 1 day ago.

Assisted by: Bigul.

Author Posts
November 19, 2024 at 5:50 am #16417610

jayl-13

I find some widgets that have new issues. Please help me.

hidden link

The "Post" category was not translated.

16413035-222222.jpg
November 19, 2024 at 6:03 am #16417684

Bigul
Supporter

Languages: English (English )

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

Hello,

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

This may be a compatibility issue. We will test it further and get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

November 24, 2024 at 4:15 pm #16437268

Bigul
Supporter

Languages: English (English )

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

Hello,

This may be related to the following ticket. So the ticket is escalated to our compatibility team for further debugging. We will get back to you as early as possible. Please wait.

https://wpml.org/errata/unlimited-elements-for-elementor-post-grid-doesnt-fetch-translated-posts/

--
Thanks!

Bigul

November 25, 2024 at 3:26 am #16437770

jayl-13

This is the support cleanup robot, making sure that nothing is left behind or forgotten. I see that you have an open support thread that’s been waiting for feedback for 3 days now.

I still need assistance.

November 25, 2024 at 2:00 pm #16440124

Bigul
Supporter

Languages: English (English )

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

Hello,

Thank you for the updates. We are still working on this issue and get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

December 10, 2024 at 5:15 pm #16499826

Bigul
Supporter

Languages: English (English )

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

Hello,

Sorry for the late response. We are getting the expected results in our test site after the following steps. Please try it after a full site backup and let us know your feedback.

1) Go to *wp-content/plugins/ultimate-elementor/modules/posts/template-blocks/* folder
2) Open *skin-style.php* file for edit
3) Scroll down to line 1088
4) Make the following changes and save the file

From

$filter_type = $settings[ $filter_by . '_' . $post_type . '_filter_rule' ];

$filters = $settings[ 'tax_' . $filter_by . '_' . $post_type . '_filter' ];

To

$filter_type = $settings[ $filter_by . '_' . $post_type . '_filter_rule' ];

// WPML Workaround for compsupp-7728
if (class_exists('Sitepress')) {
	$original_terms = $settings[ 'tax_' . $filter_by  . '_' . $post_type . '_filter' ];
	$translated_terms = [];

	foreach ($original_terms as $term_slug) {
		$term_obj = get_term_by('slug', $term_slug, $filter_by );
		
		if ($term_obj) {
			$translated_term_id = apply_filters('wpml_object_id', $term_obj->term_id, $filter_by , true);
			$translated_term = get_term($translated_term_id, $filter_by );
			if ($translated_term && !is_wp_error($translated_term)) {
				$translated_terms[] = $translated_term->slug;
			}
		}
	}

	$settings[ 'tax_' . $filter_by  . '_' . $post_type . '_filter' ] = $translated_terms;			
}

$filters = $settings[ 'tax_' . $filter_by . '_' . $post_type . '_filter' ];

Please refer to the following sample pages.

hidden link

hidden link

--
Thanks!

Bigul

December 11, 2024 at 3:54 am #16501258

jayl-13

Thanks for the update, but there is still a problem.
On the navigation bar EN is showing a specific category, the translation to es is showing ALL categories.
hidden link
You can refer to the screenshot I sent.

ES.jpg
EN.jpg
December 11, 2024 at 11:26 am #16502979

Bigul
Supporter

Languages: English (English )

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

Hello,

Thank you for the updates. However, I am not able to reproduce this exactly here - hidden link

Please check the attached images. So please clear all types of caches and make sure the issue exists or not.

If the problem remains, please share with us a screencast with the exact steps for the easy replication of the bug.

--
Thanks!

Bigul

2024-12-11_16h53_10.png
2024-12-11_16h52_01.png
December 11, 2024 at 11:50 am #16503194

jayl-13

hidden link

I cleared the cache and confirmed that the problem still exists, you view my screen recording video file.

EN page Open is on “VFFS Packaging Solutions” category
Jump to ES translated page in on “TODOS” category
In fact, the ES page is right on the “Soluciones de envasado VFFS” category.

December 11, 2024 at 5:19 pm #16504795

Bigul
Supporter

Languages: English (English )

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

Hello,

Thank you for the updates. I am consulting with our team for an expert opinion on this. We will get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

December 17, 2024 at 3:01 pm #16522384

Bigul
Supporter

Languages: English (English )

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

Hello,

Please check the test page now - hidden link. We found that it happens because, in the widget, you have set the *Default tab on page load* option active. It is working as expected after disabling it. Refer to the attached image for more details.

--
Thanks!

Bigul

screenshot 2024-12-16 às 12.09.43.png
December 18, 2024 at 10:27 am #16525131

jayl-13

My intention is for the "VFFS Packaging Solutions" tab to be displayed on page load, not the "ALL" tab. Then, when switching to Spanish, it should automatically switch to the translated "Soluciones de envasado VFFS" tab.

In fact, I can achieve this by manually editing the Spanish page, but I hope the tab can be automatically translated instead of taking an extra manual step.

Thanks!

December 19, 2024 at 3:15 pm #16530794

Bigul
Supporter

Languages: English (English )

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

Hello,

Thank you for the feedback. We are working it further now and get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

January 10, 2025 at 4:54 pm #16582801

Bigul
Supporter

Languages: English (English )

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

Hello,

Sorry for the late response becuase of the holidays. We were in touch with the plugin author. The fix for the issue is included in the upcoming version of Ultimate Addons for Elementor. So we have included it in our sandbox site now - hidden link

Please check it and let us know your feedback.

--
Thanks!

Bigul