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:
- Navigate to the
wp-content/plugins/ultimate-elementor/modules/posts/template-blocks/
folder.
- Open the
skin-style.php
file for editing.
- 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.
This topic is split from https://wpml.org/forums/topic/how-can-i-translate-the-button-links-in-the-image-gallery-widget/
This topic contains 13 replies, has 1 voice.
Last updated by 8 months, 2 weeks ago.
Assisted by: Bigul.