Skip to content

Instantly share code, notes, and snippets.

@tomhemsley
Last active August 29, 2015 14:07
Show Gist options
  • Save tomhemsley/87270edaf6247352dfef to your computer and use it in GitHub Desktop.
Save tomhemsley/87270edaf6247352dfef to your computer and use it in GitHub Desktop.
Meta Slider - Pause on slide
/**
* INSTALLATION: this code should be pasted into your theme's functions.php file.
*/
function metaslider_pause_on_slide($options, $slider_id, $settings) {
$slide_to_pause = 3; // <- change this number
// do not edit below this line
$options['after'][] = "if (slider.currentSlide == ({$slide_to_pause} - 1)) { slider.pause(); }";
return $options;
}
add_filter('metaslider_flex_slider_parameters', 'metaslider_pause_on_slide', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment