Home Forums WoodMart support forum Carousel

Carousel

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #43296

    suhrt
    Participant

    How do I create a product carousel with 2 columns in the mobile?

    Right now, it appears as a single column in mobile

    #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

Viewing 2 posts - 1 through 2 (of 2 total)