Home Forums WoodMart support forum Carousel Reply To: Carousel

#43317

Artem Temos
Keymaster

Hi,

Our carousels number of slides per view is calculated based on number of items on desktop devices. If you to make it always show 2 items on mobile you can add this code snippet to the functions.php file in the child theme

function woodmart_get_owl_items_numbers( $slides_per_view ) {
	$items = array();
	$items['desktop'] = ( $slides_per_view > 0 ) ? $slides_per_view : 1;
	$items['desktop_small'] = ( $items['desktop'] > 1 ) ? $items['desktop'] - 1 : 1;
	if ( $items['desktop'] == 6 ) $items['desktop_small'] = 4;
	$items['tablet'] = ( $items['desktop_small'] > 1 ) ? $items['desktop_small'] : 1;
	$items['mobile'] = 2;

	return $items;
}

Regards