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. | |
* | |
* - Enable CSS transitions for Flex Slider. | |
* - Fixes some issues with mobile browsers (slides go white after first complete rotation of slides) | |
* | |
* Compatibility: Flex Slider. | |
*/ | |
function metaslider_flex_use_css($options, $slider_id, $settings) { | |
$options['useCSS'] = "true"; |
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. | |
* | |
* USAGE: Leave the slide URL blank in Meta Slider. It will automatically be linked to it's full sized image. | |
* | |
* Compatibility: Flex Slider, Nivo Slider, Coin Slider, Responsive Slides. | |
*/ | |
function metaslider_link_to_full($attributes, $slide, $slider_id) { | |
if (!strlen($attributes['href'])) { | |
$attributes['href'] = wp_get_attachment_url($slide['id']); |
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. | |
* | |
* This code will convert the list of tabs into an ordered drop down menu. Ideal if you have lots of slideshows set up! | |
*/ | |
function metaslider_max_tabs() { | |
return 5; // specify the number of tabs you want to see before converting to a dropdown | |
} | |
add_filter('metaslider_max_tabs', 'metaslider_max_tabs'); |
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. | |
* | |
* Use this filter to change the margin between each image in the a carousel. | |
* | |
* [It is not possible to do with CSS alone!] | |
*/ | |
function metaslider_carousel_margin($margin, $slider_id) { | |
return 10; // value in pixels | |
} |
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
<?php | |
if (is_page() == 123) { | |
echo do_shortcode("[metaslider id=XXX]"); // Slideshow to show on page ID 123 | |
} | |
else if (is_page() == 456) { | |
echo do_shortcode("[metaslider id=XXX]"); // Slideshow to show on page ID 456 | |
} | |
else if (is_page() == 789) { | |
echo do_shortcode("[metaslider id=XXX]"); // Slideshow to show on page ID 789 | |
} |
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
/* | |
Vantage Theme, remove max width/layer centering. | |
Usage: Copy and paste this code into your themes style.css file. | |
*/ | |
body.responsive.layout-full #page-wrapper .metaslider .full-container, | |
.layout-full #page-wrapper .metaslider .full-container { | |
max-width: none; | |
} |
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
/* | |
Always show arrows (Flex Slider) | |
Usage: Copy and paste this code into your themes style.css file | |
*/ | |
.metaslider .flex-direction-nav .flex-prev { | |
opacity: 1; | |
left: 5px; | |
} | |
.metaslider .flex-direction-nav .flex-next { | |
opacity: 1; |
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. | |
* | |
* 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); |
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. | |
* | |
* 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); |
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. | |
* | |
* Use this filter to set a custom delay on the first slide in the slideshow. | |
*/ | |
function metaslider_delay_first_slide($options, $slider_id, $settings) { | |
$delay = 5000; // delay for first slide in milliseconds | |
$options['start'][] = "slider.pause(); setTimeout(function(){ slider.play(); }, {$delay});" ; | |
$options['after'][] = "if (slider.currentSlide == 0) { slider.pause(); setTimeout(function(){ slider.play(); }, {$delay}); }" ; | |
return $options; |
OlderNewer