Skip Navigation

Resolved by author

Topic Tags: Compatibility

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',
    		),
    	),
    );*/
    

2 Responses to “WoodMart - Translated Slides Not Displaying Correctly in Slider”

  1. 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.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>