简体   繁体   中英

How can I make WP Featherlight work with images like with galleries?

How can I make WP Featherlight plugin for WordPress work with images like with galleries? It allows to scroll images only when they are placed to a post as gallery. But how can I make it scroll all images in the post like all others similar plugins do?

You can download the plugin here: https://wordpress.org/plugins/wp-featherlight/

Just need to call featherlightGallery() for all images. It can be done by changing the code of the findGalleries function:

function findGalleries() {
    // Treat all images like a gallery
    $body.find( 'a[href]' ).filter( testImages ).featherlightGallery();
    ...
}

Optimized version of the code above for wpFeatherlight.pkgd.min.js file:

function g(){j.find("a[href]").filter(d).featherlightGallery();...}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM