Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomhemsley/9209493 to your computer and use it in GitHub Desktop.
Save tomhemsley/9209493 to your computer and use it in GitHub Desktop.
Loop once (flex slider)
/**
* 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 last slide)
*/
function metaslider_loop_once($options, $slider_id, $settings) {
$options['after'][] = "if ((slider.currentSlide + 1) == slider.count) { slider.pause(); }";
return $options;
}
add_filter('metaslider_flex_slider_parameters', 'metaslider_loop_once', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment