WordPress.org

Ready to get started?Download WordPress

Forums

Gallery to Slideshow
[resolved] Stop Autoplay (8 posts)

  1. hagiasofiya
    Member
    Posted 2 years ago #

    How do I stop the slideshow from being auto matic

    http://wordpress.org/extend/plugins/gallery-to-slideshow/

  2. Matt
    Member
    Plugin Author

    Posted 2 years ago #

    Hi hagiasofiya,

    You can do it by hooking into the mv_gallery_to_slideshow_attr filter, like this:

    function my_gallery_to_slideshow_settings( $params ){
    
        /*
            'thumbnails'        => true,
            'slideshow'         => true,
            'slideshowSpeed'    => 7000,
            'animationDuration' => 600,
            'mousewheel'        => false,
            'controlNav'        => false,
            'keyboardNav'       => false,
            'directionNav'      => false,
            'manualControls'    => '.pager li a img',
            'pausePlay'         => false,
            'prevText'          => __( "Previous", 'mv-gallery-to-slideshow' ),
            'nextText'          => __( "Next", 'mv-gallery-to-slideshow' ),
            'pauseText'         => __( "Pause", 'mv-gallery-to-slideshow' ),
            'randomize'         => false,
            'slideToStart'      => 0,
            'animationLoop'     => true,
            'pauseOnAction'     => true,
            'pauseOnHover'      => false,
            'controlsContainer' => '',
        */
    
        $params['slideshow'] = false;
        return $params;
    }
    add_filter( 'mv_gallery_to_slideshow_attr', 'my_gallery_to_slideshow_settings' );

    Kind Regards!

  3. vasilescu_anton
    Member
    Posted 2 years ago #

    I am not sure what am I doing wrong but after adding the code to the functions.php in my child theme, the slideshow still runs... Any ideas?

  4. vasilescu_anton
    Member
    Posted 2 years ago #

    Ok I found the issue! Your sample code is calling "mv_gallery_to_slideshow_attr" instead of "mv_gallery_to_slideshow_js_params"!

    The first hook's parameters are:

    Array
    (
        [id] => 22
        [order] => ASC
        [orderby] => menu_order ID
        [size] => full
        [link] =>
        [captions] => 1
        [exclude] =>
        [include] =>
        [numberposts] => -1
        [offset] =>
    )
  5. ariane1001
    Member
    Posted 2 years ago #

    Hello Anton, sksmatt,

    I would like to use the code so the slideshow won't be automatic. Anton, you found a solution but I can't get it to work. What should I put in functions.php exactly?

    Thanks in advance!

    Ariane

  6. Hotel Jesolo
    Member
    Posted 2 years ago #

    Hi arianne, I used "mv_gallery_to_slideshow_js_params" where the code was "mv_gallery_to_slideshow_attr" and it's ok.

  7. Matt
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Guys,

    Arian1001 is right, my mistake. The code above should be hooked to mv_gallery_to_slideshow_js_params:

    function my_gallery_to_slideshow_settings( $params ){
        /*
            'thumbnails'        => true,
            'slideshow'         => true,
            'slideshowSpeed'    => 7000,
            'animationDuration' => 600,
            'mousewheel'        => false,
            'controlNav'        => false,
            'keyboardNav'       => false,
            'directionNav'      => false,
            'manualControls'    => '.pager li a img',
            'pausePlay'         => false,
            'prevText'          => __( "Previous", 'mv-gallery-to-slideshow' ),
            'nextText'          => __( "Next", 'mv-gallery-to-slideshow' ),
            'pauseText'         => __( "Pause", 'mv-gallery-to-slideshow' ),
            'randomize'         => false,
            'slideToStart'      => 0,
            'animationLoop'     => true,
            'pauseOnAction'     => true,
            'pauseOnHover'      => false,
            'controlsContainer' => '',
        */
        $params['slideshow'] = false;
        return $params;
    }
    add_filter( 'mv_gallery_to_slideshow_js_params', 'my_gallery_to_slideshow_settings' );
  8. Perry Johnson
    Member
    Posted 1 year ago #

    Is there a way to stop auto play selectively, perhaps through a shortcode attribute? I've been probing around in the code for awhile with no success.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.