• I tried this plugin with my WP, and I’m also using the File Gallery plugin, which allows to also e.g. link PDFs and other files from a gallery. However, Featherlight also tries to display these PDF files as images. Thus, is there a way to restrict Featherlight to only display image file types the likes of jpg, png, gif?

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter carbeck

    (@carbeck)

    I did a little investigating and it looks like what I want could be achieved by modifying the buildGalleries function in js/wpFeatherlight.js. Within this function, a jQuery function .find( '.gallery-item a' ) is called twice with slight variation (.gallery-item and .tiled-gallery-item). This makes the lightbox apply to any links in WP galleries.

    As I mentioned, however, the File Gallery plugin allows you to place non-image files in galleries as well in order to list files by tag from the Media Library. I suspect that what I want can be achieved by changing the jQuery function call to .find( '.gallery-item a[data-featherlight=image]' ) (mutatis mutandis) to capture only those links in WP galleries which link to image files when creating a lightbox gallery.

    Edit: I just tested it, and indeed, by filtering image links from WP galleries specifically, Featherlight will only consider image files for lightbox gallery creation. It’d be nice if the plugin authors could consider such a feature for future versions in some way.

    • This reply was modified 5 years, 10 months ago by carbeck.
Viewing 1 replies (of 1 total)
  • The topic ‘Restrict to image file types?’ is closed to new replies.