Resolved by author
Overview of the issue
Users of the WoodMart theme may encounter an issue where translated slides display on the default language slider. Instead, when switching languages, the translated slides do not appear at all.
Workaround
Please, make sure of having a full site backup of your site before proceeding.
Part I
- Open Open the …/wp-content/themes/woodmart/inc/shortcodes/slider.php file.
- Look for line 103.
- Replace:
$args = array( 'posts_per_page' => -1, 'post_type' => 'woodmart_slide', 'orderby' => 'menu_order', 'order' => 'ASC', 'tax_query' => array( // phpcs:ignore array( 'taxonomy' => 'woodmart_slider', 'field' => 'id', 'terms' => $slider_term->term_id, ), ), );
- With:
$args = array( 'posts_per_page' => -1, 'post_type' => 'woodmart_slide', 'orderby' => 'menu_order', 'order' => 'ASC', 'suppress_filters' => false, 'tax_query' => array( // phpcs:ignore array( 'taxonomy' => 'woodmart_slider', 'field' => 'id', 'terms' => $slider_term->term_id, ), ), );
Part II
- Open …/wp-content/themes/woodmart/inc/integrations/wpml/wpml.php file.
- Look for line 28.
- Replace:
$widgets['wd_slider'] = array( 'conditions' => array( 'widgetType' => 'wd_slider' ), 'fields' => array( array( 'field' => 'slider', 'type' => esc_html__( '[Slider] - Slider', 'woodmart' ), 'editor_type' => 'LINE', ), ), );
- With:
/*$widgets['wd_slider'] = array( 'conditions' => array( 'widgetType' => 'wd_slider' ), 'fields' => array( array( 'field' => 'slider', 'type' => esc_html__( '[Slider] - Slider', 'woodmart' ), 'editor_type' => 'LINE', ), ), );*/
there is no such code in the wpml.php file…. Slides are not translated, they are displayed in the original language, although translation is added manually
This workaround is not applied in WPML but in Woodmart theme, more precisely in …/wp-content/themes/woodmart/inc/shortcodes/slider.php file.
If you have issues trying to add this workaround, please start a chat in our assistance channel, one of our specialists will be able to help you.