I’m a big fan of the WordPress plugin WP Featherlight.
WP Featherlight looks through post content and finds images that link to themselves and turn their links into lightbox-ready images, which helps visitors magnify the image with the click of a button.
Want to see it in action? Here, we have it installed on this site. Click the image below:
We noticed that the Featherlight framework that WP Featherlight Plugin uses has iframe/YouTube support, but we couldn’t figure out how to make the official WP Featherlight plugin tell our images to launch YouTube videos when visitors clicked images.
We ended up forking the original WP Featherlight plugin and we made a few modifications to support this needed case scenario.
Here, try clicking on Cameron Frye at the Museum again below.
Pretty cool right?!
To get this effect all I had to do was tell Gutenberg to link the image to the YouTube video and the modded plugin took care of the rest.
For the modified version, please head to the git repository below:
Experimenting with adding YoutTube support to WP Featherlight