Support » Plugin: WP Gallery Custom Links » I've set my gallery to keep Lightbox effects but doesn't launch media

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m not familiar with your theme/plugin for doing the shadowbox, but I noticed that on the first image, the link “rel” attribute looks like this:

    rel="shadowbox[sbpost-145];player=swf;width=640;height=385;"

    and on the gallery image the rel looks like this:

    rel="shadowbox[sbalbum-15];player=img;"

    I’m guessing that the rel on the gallery image needs to match the one on the standalone image, or at least have “player=swf” since it’s a video, but I’m not sure how you’d change that for your particular site. Maybe jQuery?

    Ah, gotcha. Do you have a lightbox plugin that works well with WP Gallery Custom Links? I’m using the plugin Shadowbox JS for the lightbox feature. I’d rather swap it out for a different one that works with WP Gallery Custom Links. I appreciate the help.

    Technically it *is* working with your plugin, but your plugin appears to be assuming gallery items will be linked to images and brings up the image viewer even though the links are for videos. Try putting the following in your footer to change the rel attribute on gallery images from “img” to “swf” for the video player:

    <script>
    var galleryImages = jQuery('#gallery-2 .gallery-icon a');
    galleryImages.each(function(){
      var currentRel = jQuery(this).attr('rel');
      var videoRel = currentRel.replace(/player=img;/,'player=swf;width=640;height=385;');
      jQuery(this).attr('rel',videoRel);
    });
    </script>

    You may need to tweak this script depending on which galleries/images you want to use it on, etc.

    Actually, you might want to put that in the footer before where the shadowbox script is included, so the changes go in before shadowbox loads with the rel attributes that are there.

    Marking this as resolved since the poster has no further input.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘I've set my gallery to keep Lightbox effects but doesn't launch media’ is closed to new replies.