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. | |
*/ | |
function metaslider_ipad_fix($options, $slider_id, $settings) { | |
$options['after'][] = "slider.pause(); slider.play();"; | |
return $options; | |
} | |
add_filter('metaslider_flex_slider_parameters', 'metaslider_ipad_fix', 10, 3); |
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. | |
* | |
* To Use: Install 'Easy Fancybox'. Leave the URL blank on an image slide in Meta Slider. | |
* The slide will automatically be linked to it's full image in a lightbox | |
*/ | |
function metaslider_easy_fancybox($attributes, $slide, $slider_id) { | |
if (!strlen($attributes['href'])) { | |
$attributes['href'] = wp_get_attachment_url($slide['id']); | |
$attributes['class'] = 'fancybox'; |
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
function metaslider_change_defaults($params) { | |
// var_dump($params); | |
$params['type'] = 'responsive'; | |
$params['width'] = 1920; | |
$params['height'] = 620; | |
// change any other parameters that need to be changed | |
return $params; |
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. | |
* | |
*/ | |
function metaslider_slide_change_callback($options, $slider_id, $settings) { | |
$options['after'][] = " | |
// debug | |
console.log("current slide: " + slider.currentSlide); | |
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. | |
* | |
* Compatibility: Flex Slider. | |
*/ | |
function metaslider_flex_controls($options, $slider_id, $settings) { | |
$options['controlsContainer'] = ".thumbnails"; | |
return $options; | |
} | |
add_filter('metaslider_flex_slider_parameters', 'metaslider_flex_controls', 11, 3); |
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
function metaslider_restrict_tags($args) { | |
$args['popular_cats'] = true; | |
return $args; | |
} | |
add_filter("metaslider_post_feed_wp_terms_checklist_args", 'metaslider_restrict_tags'); |
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
function metaslider_flex_ie11_animation_fix_js($js, $slider_id) { | |
$js .= "\n $('#metaslider_{$slider_id} li .animated').each(function(index) { | |
var el = $(this); | |
var cloned = el.clone(); | |
el.before(cloned); | |
$(this).remove(); | |
});"; | |
return $js; | |
} | |
add_filter('metaslider_flex_slider_javascript_before', 'metaslider_flex_ie11_animation_fix_js', 11, 2); |
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
function metaslider_flex_ie11_animation_fix($options, $slider_id, $settings) { | |
$options['start'][] = "$('#metaslider_{$slider_id} li .animated').each(function(index) { | |
var el = $(this); | |
var cloned = el.clone(); | |
el.before(cloned); | |
$(this).remove(); | |
});"; | |
return $options; | |
} | |
add_filter('metaslider_flex_slider_parameters', 'metaslider_flex_ie11_animation_fix', 11, 3); |
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
function metaslider_fixed_carousel($options, $slider_id, $settings) { | |
$options['minItems'] = 4; // min number of slides that will always be displayed. Slideshow will be scaled down if necessary. | |
$options['maxItems'] = 4; // max number of slides that will always be displayed. Slideshow will be scaled up if necessary. | |
return $options; | |
} | |
add_filter('metaslider_flex_slider_parameters', 'metaslider_fixed_carousel', 11, 3); |