Questo thread è stato risolto. Ecco una descrizione del problema e della soluzione.
Problem:
The client needed a solution for displaying the 'post grid' widget from correctly in a multilingual setup using WPML. The issue happens only if you switch the default language from English to another language.
Solution:
We provided a workaround to be added to the functions.php file. Here is the code that should be inserted:
// WPML Workaround for compsupp-7881<br />add_filter( 'elementor/frontend/before_render', 'wpml_compsupp7881_filter_post_grid_widget');<br /><br />function wpml_compsupp7881_filter_post_grid_widget($element) {<br /> if ( 'posts' !== $element->get_name() ) {<br /> return;<br /> }<br /><br /> $settings = $element->get_settings();<br /><br /> if ( isset( $settings['posts_include_term_ids'] ) && is_array( $settings['posts_include_term_ids'] ) ) {<br /><br /> // Query by terms<br /> foreach ( $settings['posts_include_term_ids'] as $key => $id ) {<br /><br /> $taxonomy = 'category';<br /><br /> $term = get_term($term_id);<br /><br /> if ($term instanceof WP_Term) {<br /> $taxonomy = $term->taxonomy;<br /> }<br /><br /> $id = apply_filters( 'wpml_object_id', $id, $taxonomy, true );<br /><br /> unset($settings['posts_include_term_ids'][$key]);<br /> $settings['posts_include_term_ids'][] = $id;<br /><br /> }<br /><br /> // Update the settings<br /> $element->set_settings( 'posts_include_term_ids', $settings['posts_include_term_ids'] );<br /> }<br />}
Please note that this solution might be outdated or not applicable to your specific case. If this workaround does not resolve your issue, 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.
Questo è il forum di assistenza tecnica di WPML, il plug-in multilingue di WordPress.
La sua lettura è permessa a tutti, ma la pubblicazione è riservata esclusivamente ai clienti di WPML. Il team di WPML risponde sul forum 6 giorni su 7, 22 ore su 24.
Questo argomento è diviso da https://wpml.org/it/forums/topic/traduzione-del/
Questo ticket contiene 3 risposte, ha 0 voci.
Ultimo aggiornamento da 1 mese, 1 settimana fa.
Assistito da: Laura.