Created
February 27, 2014 10:07
-
-
Save tomhemsley/9247444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* INSTALLATION: this code should be pasted into your theme's functions.php file. | |
* | |
* Use this filter to set a custom delay time on any slide in the slideshow | |
* ... apart from the first slide! If you need to delay the first slide | |
* ... see https://gist.github.com/tomhemsley/9247378 | |
*/ | |
function metaslider_delay_slide($options, $slider_id, $settings) { | |
$delay = 5000; // delay in milliseconds | |
$slide_to_delay = 2; // 1 = first, 2 == second.. | |
$options['after'][] = "if (slider.currentSlide == ({$slide_to_delay} - 1)) { slider.pause(); setTimeout(function(){ slider.play(); }, {$delay}); }" ; | |
return $options; | |
} | |
add_filter('metaslider_flex_slider_parameters', 'metaslider_delay_slide', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment