Home Forums WoodMart support forum Rewind Information box carousel

Rewind Information box carousel

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #81911

    jotten
    Participant

    Hey there,

    Is it possible to rewind the slider to the first item in the element ‘Information Box Carousel’?

    With kind regards.

    #81922

    Artem Temos
    Keymaster

    Hi,

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    function woodmart_shortcode_info_box_carousel( $atts = array(), $content = null ) {
    		$output = $class = $autoplay = '';
    
    		$parsed_atts = shortcode_atts( array_merge( woodmart_get_owl_atts(), array(
    			'slider_spacing' => 30,
    			'dragEndSpeed' => 600,
    			'el_class' => '',
    		) ), $atts );
    
    		extract( $parsed_atts );
    
    		$class .= ' ' . $el_class;
    		$class .= ' ' . woodmart_owl_items_per_slide( $slides_per_view );
    
    		$carousel_id = 'carousel-' . rand(100, 999);
    
    		$parsed_atts['carousel_id'] = $carousel_id;
    		$parsed_atts['wrap'] = 'yes';
    		$owl_atts = woodmart_get_owl_attributes( $parsed_atts );
    		
    		ob_start(); ?>
    			<div id="<?php echo esc_attr( $carousel_id ); ?>" class="woodmart-carousel-container info-box-carousel-wrapper woodmart-carousel-spacing-<?php echo esc_attr( $slider_spacing ); ?>" <?php echo ( $owl_atts ); ?>>
    				<div class="owl-carousel info-box-carousel<?php echo esc_attr( $class ); ?>" >
    					<?php echo do_shortcode( $content ); ?>
    				</div>
    			</div>
    		<?php
    		$output = ob_get_contents();
    		ob_end_clean();
    
    		return $output;
    	}
    	add_shortcode( 'woodmart_info_box_carousel', 'woodmart_shortcode_info_box_carousel' );

    Regards

    #81956

    jotten
    Participant

    Hello,

    That works!
    Can I ask a different question, but related to the carousel, within this ticket?
    Or do I have to open up a new one?

    Thanks!

    #81971

    Hello,

    You can go on here. Feel free to ask.

    Best Regards

    #82131

    jotten
    Participant

    Hi,

    I was struggling to get the carousel to show op nice on mobile (see Attachments).
    I would like to have just 1 item but I just can’t seem to get my CSS right.
    This doesn’t seem to be a simple setting, although I would assume that this theme would have this as there are alot of Responsive options for different elements.

    Could you help me with this?
    I can provide you with WordPress credentials if needed.

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #82143

    Hello,

    Please provide your site admin access and page URL I will check the settings.

    Best Regards

    #82157

    jotten
    Participant

    Done.

    #82171

    Hello,

    Please check the access again I insert and have this result https://gyazo.com/a1afc829c171cf631314d4e8f78269aa

    Then I insert again and the same.

    Best Regards

    #82176

    jotten
    Participant

    Hey,

    For both fields: login
    When on the WP login-page use the credentials used when taking the screen capture.

    Thanks!

    #82210

    Artem Temos
    Keymaster

    Your admin password is wrong and we can’t access. Try to add the following PHP code snippet to the child theme functions.php file to do this

    function woodmart_shortcode_info_box_carousel( $atts = array(), $content = null ) {
    		$output = $class = $autoplay = '';
    
    		$parsed_atts = shortcode_atts( array_merge( woodmart_get_owl_atts(), array(
    			'slider_spacing' => 30,
    			'dragEndSpeed' => 600,
    			'el_class' => '',
    		) ), $atts );
    
    		extract( $parsed_atts );
    
    		$class .= ' ' . $el_class;
    		$class .= ' ' . woodmart_owl_items_per_slide( $slides_per_view );
    
    		$carousel_id = 'carousel-' . rand(100, 999);
    
    		$parsed_atts['carousel_id'] = $carousel_id;
    		$parsed_atts['custom_sizes'] = array(
    			'desktop' => 4,
    			'tablet_landscape' => 3,
    			'tablet' => 2,
    			'mobile' => 1,
    		);
    		$owl_atts = woodmart_get_owl_attributes( $parsed_atts );
    		
    		ob_start(); ?>
    			<div id="<?php echo esc_attr( $carousel_id ); ?>" class="woodmart-carousel-container info-box-carousel-wrapper woodmart-carousel-spacing-<?php echo esc_attr( $slider_spacing ); ?>" <?php echo ( $owl_atts ); ?>>
    				<div class="owl-carousel info-box-carousel<?php echo esc_attr( $class ); ?>" >
    					<?php echo do_shortcode( $content ); ?>
    				</div>
    			</div>
    		<?php
    		$output = ob_get_contents();
    		ob_end_clean();
    
    		return $output;
    	}
    	add_shortcode( 'woodmart_info_box_carousel', 'woodmart_shortcode_info_box_carousel' );
    #82213

    jotten
    Participant

    Hello,

    Don’t know why you’re having trouble, currently I’m logged in with provided credentials.
    Anyhow the snippet works and it is fixed, thanks!

    With kind regards.

    #82214

    Artem Temos
    Keymaster

    Great, you are welcome!

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

The topic ‘Rewind Information box carousel’ is closed to new replies.