- This topic has 8 replies, 4 voices, and was last updated 2 years, 3 months ago by Nick.
September 30, 2018 at 5:35 am #689888Leon
I’m wondering if it’s possible for you to share how you make the videos load on click only.
I guess you just put an image with a play icon.
But how do you make this happen: after clicking the image, the video will play in a popup window?
Thank you in advance.
LeonSeptember 30, 2018 at 10:12 am #690093TomLead DeveloperLead Developer
We used this jQuery library: https://github.com/jsor/lity
If you’re not comfortable setting up a library like that, a plugin like this might help: https://wordpress.org/plugins/wp-featherlight/September 30, 2018 at 11:15 am #690112Leon
Thank you Tom. Made it with featherlight.
Cheers~September 30, 2018 at 10:09 pm #690321TomLead DeveloperLead DeveloperAugust 17, 2019 at 2:36 am #986345Roman
Hi Tom, I have managed to run Lity on my website. I would like to ask you for help with following issue. Lity needs ‘data-lity’ attribute inside the
<a>tag. It is not a problem to insert it manually while creating a link, but I would like to use Lity for images inserted in the post through the ‘insert media’ dialog box. I have been trying hard to setup some filter or hook to automatically add ‘data-lity’ inside the image link tag (both for new and already uploaded images). Could you point me to the right direction please? I think the solution might by somewhere around wp core caption shortcode…August 17, 2019 at 10:06 am #986659TomLead DeveloperLead DeveloperAugust 18, 2019 at 12:06 am #986972Roman
Tank you, Tom. The filter image_send_to_editor works, but only for media uploaded in the wordpress media library. It seems that wordpress uses another function to create image links for media added from external URLs. Any ideas?August 18, 2019 at 10:06 am #987378TomLead DeveloperLead Developer
Strange, I would think that filter would work regardless of where the image is coming from, as they all get added to the editor.
Other than that, you might need to find some code that filters
the_content, but that might be somewhat buggy.October 21, 2019 at 11:26 am #1040602Nick
Edit: Figured out how to get Lity working no reply needed.
- The topic ‘Load video only on click like that on generatepress.com’ is closed to new replies.