Skip to content

Adds Lightbox's popup capability to default Gutenberg Gallery block

Notifications You must be signed in to change notification settings

felixprojekt/gutenberg-gallery-lightbox-snippet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Lightbox for default Guttenberg gallery block

Simple jQuery script that adds Lightbox's popup to default Gutenberg Gallery block. Meant for custom-coded themes.

How-to

  • Download and include Lightbox in your theme/child-theme
  • Add gallery-lightbox.js to your theme/child-theme
  • Localize your script to contain URL to media JSON:
wp_enqueue_script('gallery-lightbox', get_template_directory_uri() . '/js/gallery-lightbox.js', array('jquery'), 1, true);
wp_localize_script("gallery-lightbox", "php_vars", ["mediaurl" => get_home_url() . "/wp-json/wp/v2/media/"]);

About

Adds Lightbox's popup capability to default Gutenberg Gallery block

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published