
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
and videos displayed by
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.
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).
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" )'; } ); 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' ); } }); add_filter('use_lightbox_css', function () { return true; });
Optimize More! – A DIY WordPress Page Speed Optimization Pack. Features:
Lazyload, Preload, and more! – This tiny little plugin (around 14kb zipped) will automatically:
Shop Extra – A lightweight plugin to optimize your WooCommerce & Business site:
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.
Starting from $0 per month.
Rating
Reviewers
No reviews
Tags
Developed By
Arya Dhiratara
Quick & Easy
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 plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Create structured layouts with a section builder that lets you design custom website sections, customize styles, and organize content for a clearer user experience.
Show Threads posts in a live feed that keeps content fresh, builds social proof, and helps visitors engage on your site.

Showcase visuals with an image wall that creates a parallax style gallery, offers smooth scrolling, and presents images in customizable, engaging layouts.
Create and customize product catalogs with a catalog widget that organizes items clearly, improves browsing, and helps visitors explore your offerings easily.
Create interactive diagrams with a diagrams widget that lets you build and customize flow charts, improve clarity, and help visitors understand complex ideas easily.
Add a comments system with replies, voting, and moderation to boost engagement and build an active community on your site.
Use a live weather forecast widget to show current conditions and upcoming predictions, giving visitors real time local weather updates for better planning.
Showcase visuals with an image slider that displays multiple images in a smooth slideshow, improves design, and keeps visitors engaged.

Collect event responses with an RSVP form that lets guests register easily, saves submissions, sends notifications, and helps you organize attendance efficiently.
Use an event list to highlight upcoming activities, improve visibility, and help visitors discover events that increase attendance and engagement.
Create real estate listings with a listings widget that displays properties clearly, supports customization, and helps visitors explore homes more easily.
Add a translation widget to your site so users can switch languages easily and access content in their preferred language.
More plugins
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!
