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/9344977 to your computer and use it in GitHub Desktop.
Save tomhemsley/9344977 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 allow linking to a specific slide (Flex Slider only)
* Eg, http://www.yourSiteUrl.com/yourPage?startAt[563]=3&startAt[123]=2
*/
function metaslider_flex_start_slide($options, $slider_id, $settings) {
if (isset($_GET['startAt'][$slider_id])) {
$start_slide = intval($_GET['startAt'][$slider_id]) - 1;
if ($start_slide > 0) {
$options['startAt'] = $start_slide;
}
}
return $options;
}
add_filter('metaslider_flex_slider_parameters', 'metaslider_flex_start_slide', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment