How To Add Lightbox to Your WordPress Gallery

The code in this mini plugin folder adds the lightbox popup affect to the images in your WordPress gallery. The code :

  1. Can be used as a plugin and simply install the affect in 1 click.
  2. Can be Copied and pasted into your child themes functions file and use it as is or modify it.
  3. Includes a function which enables you to add the lightbox attribute and any other attributes to your WordPress gallery images.
  4. Loads the lightbox scripts directly from the official CDN.

Lightbox 2 is small javascript library used to overlay images on top of the current page. It’s a snap to setup and works on all modern browsers.

add light box to wordpress gallery

Demo Video

Shows the gallery images displaying in a light box when using the create gallery function built into the media functionality native to WordPress.

Works in any WordPress theme.

Installation

Install the zip folder as a new plugin or copy and paste the PHP code to the end of your child themes functions file and clear caching.

Download Folder

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.