Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomhemsley/9209552 to your computer and use it in GitHub Desktop.
Save tomhemsley/9209552 to your computer and use it in GitHub Desktop.
/**
* INSTALLATION: this code should be pasted into your theme's functions.php file.
*
* Use this filter to stop Flex Slider from looping back to the start of the slideshow (ending on the first slide, after a complete rotation)
*/
function metaslider_loop_once_stop_on_first($options, $slider_id, $settings) {
$options['after'][] = "if (slider.currentSlide == 0) { slider.pause(); }" ;
return $options;
}
add_filter('metaslider_flex_slider_parameters', 'metaslider_loop_once_stop_on_first', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment