Skip to content

Instantly share code, notes, and snippets.

@tomhemsley
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomhemsley/9463214 to your computer and use it in GitHub Desktop.
Save tomhemsley/9463214 to your computer and use it in GitHub Desktop.
/**
* INSTALLATION: this code should be pasted into your theme's functions.php file.
*
* To Use: Install 'Simple Lightbox'. 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_simple_lightbox($attributes, $slide, $slider_id) {
if (!strlen($attributes['href'])) {
$attributes['href'] = wp_get_attachment_url($slide['id']);
$attributes['data-slb-group'] = $slider_id;
$attributes['data-slb-active'] = "1";
$attributes['data-slb-internal'] = "0";
}
return $attributes;
}
add_filter('metaslider_flex_slider_anchor_attributes', 'metaslider_simple_lightbox', 10, 3);
add_filter('metaslider_nivo_slider_anchor_attributes', 'metaslider_simple_lightbox', 10, 3);
add_filter('metaslider_responsive_slider_anchor_attributes', 'metaslider_simple_lightbox', 10, 3);
add_filter('metaslider_coin_slider_anchor_attributes', 'metaslider_simple_lightbox', 10, 3);
/* END metaslider /simple lightbox integration */
@kimhim
Copy link

kimhim commented Jun 17, 2014

Dear every one!
After I installed simple lightbox. it work for simple image have a popup, but it is does not work with slideshow. Any one experience with this problem please help me. thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment