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_min_items($options, $slider_id, $settings) { | |
$options['minItems'] = 2; // number of slides that will always be displayed. Slideshow will be scaled down if necessary. | |
return $options; | |
} | |
add_filter('metaslider_flex_slider_parameters', 'metaslider_flex_min_items', 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_title_attribute($attributes, $slide, $slider_id) { | |
if (!strlen($attributes['alt'])) { | |
$attributes['alt'] = get_the_title($slide['id']); | |
} | |
return $attributes; | |
} | |
add_filter('metaslider_flex_slider_image_attributes', 'metaslider_title_attribute', 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
add_filter('metaslider_flex_slider_image_attributes', 'metaslider_nopin', 10, 3); | |
function metaslider_nopin($attributes, $slide, $slider_id) { | |
$attributes['nopin'] = "nopin"; | |
return $attributes; | |
} |
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
@media screen and (max-width: 480px) { | |
.metaslider .caption-wrap { | |
display: 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
/** | |
* INSTALLATION: this code should be pasted into your theme's functions.php file. | |
* | |
* This code will display a counter in the form of "X / Y" (where X is the current slide and Y is the total number of slides) below the slideshow. | |
*/ | |
function metaslider_add_counter_div($options, $slider_id, $settings) { | |
$options['start'][] = " | |
var container = $('<div />').addClass('counter_{$slider_id}').css({ | |
'text-align' : 'center', |
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
/** | |
* Output the slideshow to the 'after_header' section of the theme | |
*/ | |
add_action('genesis_after_header', 'metaslider_homepage_slider', 10, 1); | |
function metaslider_homepage_slider() { | |
if (is_front_page()) { | |
echo do_shortcode("[metaslider id=123 percentwidth=100]"); // replace 123 with your slidehsow 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
function metaslider_flex_max_items($options, $slider_id, $settings) { | |
$options['maxItems'] = 3; // max number of slides that will always be displayed. | |
return $options; | |
} | |
add_filter('metaslider_flex_slider_parameters', 'metaslider_flex_max_items', 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
/** | |
* INSTALLATION: this code should be pasted into your theme's functions.php file. | |
* | |
* Don't pause the slideshow when interacting with control elements. | |
*/ | |
function metaslider_flex_disable_pause_on_action($options, $slider_id, $settings) { | |
$options['pauseOnAction'] = 'false'; | |
return $options; | |
} | |
add_filter('metaslider_flex_slider_parameters', 'metaslider_flex_disable_pause_on_action', 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
/** | |
* INSTALLATION: this code should be pasted into your theme's functions.php file. | |
* | |
* USAGE: | |
* Install 'WP Video Lightbox'. | |
* Add an image slide to your Meta Slider slideshow and enter a YouTube or Vimeo URL into the URL field. | |
* | |
* eg: http://vimeo.com/29417470?width=800&height=450 | |
* http://www.youtube.com/watch?v=G7z74BvLWUg&width=640&height=480 | |
*/ |