Image & Video Lightbox

Image & Video Lightbox

Wordpress plugin

Install on Wordpress

App Details

Automatically adds Lightbox functionality to images displayed by WordPress (Gutenberg) Gallery and Image Blocks, as well as GenerateBlocks Image Blocks, and also videos created by the core Video Block, using the FSlightbox library.

This lightweight plugin will automatically adds Lightbox functionality to all images displayed by

  • the Core Gallery Block,
  • the Core Image Block,
  • GenerateBlocks Image Block,

and videos displayed by

  • the core Video Block

without the needs to set each gallery/image and video link to the media file so you don’t need to set them manually one by one.

Note: You can exclude specific image/video from getting the lightbox functionality by adding no-lightbox class to the image/video element.

About The Plugin

  • This plugin has no settings (you can customized the default configuration using filters), hence does not add any data to the database, so you don’t need to worry about ‘database leftovers’ if you deactivate the plugin.

  • This plugin will automatically add the wrapper link with the necessary attribute on each image and videos that uses the blocks mentioned above to add the lightbox functionality using a few lines of inline script. So it will not make any changes to your original image and video tags (if you check from the page’s HTML source), and will not add extra weight / DOM depth to your page’s HTML.

  • By default, this plugin only works with the native WordPress Gallery, Image, and Video Blocks, as well as GenerateBlocks Image Blocks. You can add additional selectors using filters to make this functionality also works with other image/video blocks. If you need to, send me a request to have your image/video block included by default.

  • This plugin will only enqueued its assets (1 JS file) to pages/posts that use blocks, and will not enqueue assets if the page/post doesn’t use one of them.

  • I provided simple hover CSS which are not enabled by default. You can enable it using filter (see below).

To add other image/video block:

Add the CSS class uses by the image/video block element, e.g:

add_filter( 'use_lightbox_in', function($use_lightbox_in) { return $use_lightbox_in . ',.your-other-plugin-block-image-parent-element img, .your-other-plugin-image-class'; } ); 

Add the block info/name so that this plugin will enqueued the FSlightbox JavaScripts if the block is use in a post/page, e.g:

add_filter( 'use_lightbox_if', function($use_lightbox_if) { return $use_lightbox_if . '|| has_block( "kadence/advancedgallery" ) || has_block( "your-plugin-block-name/the-block-name" )'; } ); 

To only enable Lightbox Functionality on certain page/post types:

Simply use the wp_dequeue function**, e.g.:

add_action( 'wp_enqueue_scripts', function() { if ( ! is_singular('post') ) { // only enable in single post type wp_dequeue_script( 'image-video-lightbox' ); } }); 

To only enable simple hover CSS:

add_filter('use_lightbox_css', function () { return true; }); 

Why using FSlightbox?

  • FSlightbox is Vanilla Javascript Lightbox Library written in pure JavaScript without jQuery or any other additional dependencies. It’s lightweight (around 9kb *gzip)!
     
  • The JavaScript is delayable (*yes, it’s important for me). This is the only lightbox library I found that works when the JavaScript is delayed.

 

My other Plugins:

  • Optimize More! – A DIY WordPress Page Speed Optimization Pack. Features:

    • Load CSS Asynchronously – selectively load CSS file(s) asynchronously on selected post/page types.
    • Delay CSS and JS until User Interaction – selectively delay CSS/JS load until user interaction on selected post/page types.
    • Preload Critical CSS, JS, and Font Files – selectively preload critical CSS/JS/Font file(s) on selected post/page types.
    • Remove Unused CSS and JS Files – selectively remove unused CSS/JS file(s) on selected post/page types.
    • Load Gutenberg CSS conditionally – Load each CSS of the core blocks will only get enqueued when the block gets rendered on a page.
    • Advance Defer JS – hold JavaScripts load until everything else has been loaded. Adapted from the legendary varvy’s defer js method *recommended for defer loading 3rd party scripts like ads, pixels, and trackers
    • Defer JS – selectively defer loading JavaScript file(s) on selected post/page types.
    • Remove Passive Listener Warnings – Remove the “Does not use passive listeners to improve scrolling performance” warning on Google PageSpeed Insights
  • Lazyload, Preload, and more! – This tiny little plugin (around 14kb zipped) will automatically:

    • lazyload your below the fold images/iframes/videos,
    • preload your featured images,
    • and add loading="eager" to your featured image and all images that have no-lazy or skip-lazy class.
  • Shop Extra – A lightweight plugin to optimize your WooCommerce & Business site:

    • Floating WhatsApp Chat Widget (can be use without WooCommerce),
    • WhatsApp Order Button for WooCommrece,
    • Hide/Disable WooCommerce Elements,
    • WooCommerce Strings Translations,
    • and many more.
  • Animate on Scroll – Animate any Elements on scroll using the popular AOS JS library simply by adding class names. This plugin helps you integrate easily with AOS JS library to add any AOS animations to WordPress. Simply add the desired AOS animation to your element class name with “aos-” prefix and the plugin will add the corresponding aos attribute to the element tag.

 

Pricing

Starting from $0 per month.

Check Out the Interactive Video Player Widget

By Common Ninja

Interactive Video PlayerTry For Free!

App Info

Rating

Reviewers

No reviews

Tags

blocks
gallery
image
lightbox
video

Developed By

Arya Dhiratara

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Interactive Video Player for Wordpress logo

Interactive Video Player

Add interactive video overlays with links, product cards, and buttons that appear on top of your videos to boost engagement and guide user actions.

Course Registration Form for Wordpress logo

Course Registration Form

Use a scroll progress bar that visually tracks reading on the page, improves navigation, and keeps visitors aware of their position.

Job Listings for Wordpress logo

Job Listings

Create job listings with a jobs board widget that lets you post openings, manage roles easily, and help candidates find the right positions quickly.

Subscription Button for Wordpress logo

Subscription Button

Use a subscription button to streamline recurring payments, simplify signup, and help increase conversions with seamless PayPal or Stripe integration.

RSVP Form for Wordpress logo

RSVP Form

Collect event responses with an RSVP form that lets guests register easily, saves submissions, sends notifications, and helps you organize attendance efficiently.

Feedback Form for Wordpress logo

Feedback Form

Collect user insights with a feedback form that gathers valuable input, improves user experience, and helps you understand visitor needs more clearly.

Reviews Badge for Wordpress logo

Reviews Badge

Use a reviews badge to highlight your ratings, build trust at a glance, improve credibility, and help increase conversions across your site.

Code Snippets for Wordpress logo

Code Snippets

Display clean code snippets with syntax highlighting to improve technical content and help developers scan examples quickly.

Order Form for Wordpress logo

Order Form

Use an order form to let customers submit product orders, save entries, receive notifications, and collect payments through PayPal or Stripe for a smoother buying experience.

Personality Quiz for Wordpress logo

Personality Quiz

Create interactive personality quizzes with custom results and flexible design to boost engagement and help visitors explore tailored outcomes easily.

Card Carousel for Wordpress logo

Card Carousel

Showcase content with a card carousel that combines images and text, improves visual design, and helps visitors explore key information.

Creative Card Carousel for Wordpress logo

Creative Card Carousel

Showcase content with a creative card carousel that rotates banner style items to highlight offers and important messages.

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms