• Resolved coe13

    (@coe13)


    For some reason, when using the Justified Gallery, when I click the image it just opens in the tab, instead of being displayed as a popup modal. I’m using the shortcode to display the gallery. The gallery displays fine on the page. In the settings, the image and gallery selectors are just the default ones, which are correct. I disabled any plugins that could be conflicting, but it still doesn’t work. I’m using the Squaretype theme from Code Supply that I bought off Theme Forest, so that can’t be the issue.

    Any ideas? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter coe13

    (@coe13)

    It’s only the gallery created with the shortcode that doesn’t work. Using the gallery widget in an editor in the admin area works fine. It’s only the shortcode that doesn’t work. Unfortunately, I have to use the shortcode for the pages I’m using the gallery on.

    Thread Starter coe13

    (@coe13)

    Okay, I’ve figured it out. class-powerkit-gallery.php has this code in it:

    if ( ! empty( $atts['link'] ) && 'file' === $atts['link'] ) {
         $image_output = wp_get_attachment_link( $id, $atts['size'], false, false, false, $attr );
    } elseif ( ! empty( $atts['link'] ) && 'none' === $atts['link'] ) {
         $image_output = wp_get_attachment_image( $id, $atts['size'], false, $attr );
    } else {
         $image_output = wp_get_attachment_link( $id, $atts['size'], true, false, false, $attr );
    }

    So, unless you add a link=”file” attribute to the shortcode, it will default to the image permalink instead of the direct URL. However, the permalink does not include the image file extension and the javascript that enables the lightbox checks the link URL for a valid image file extension. The problem is, the documentation (at least for the Squaretype theme) does not mention this at all.

    So, if you are trying to use the justified gallery shortcode and it’s not working, add link=”file” to the shortcode. The developers need to fix this issue, either by changing the code or changing the documentation.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t seem to get Justified Gallery images to work’ is closed to new replies.