Skip to content

OG Lightbox

OG Lightbox opens your images full size in a clean, responsive viewer. It can show the photo's EXIF data (camera, lens, shutter speed and more) and, with a licence, the place it was taken on a map.

Requires: WordPress 6.0+, PHP 8.1+, the PHP exif extension, and permalinks set to anything other than Plain.

Buy or download: OG Lightbox in the OG Store

Who it's for

  • Photographers and portfolio sites that want visitors to see the camera settings behind each shot.
  • Travel and outdoor sites that want to show where a photo was taken.
  • Any site that wants a fast lightbox for WordPress galleries, image blocks and OG Gallery.

Install and activate

Download the zip from My Account > Licences on og-nexus.com, upload it in Plugins > Add New > Upload Plugin, then activate it. Paste your licence key on the License tab of the plugin. The full steps are in Install and activate.

The lightbox works as soon as the plugin is active. You do not have to change any setting first.

Features that need a licence

Hide Arrows on Mobile, Slideshow, Deep Linking, Social Sharing and Location Map stay locked until your licence key is validated on the License tab.

Where to find it

Open OG Nexus > Lightbox in the WordPress menu. If OG AI Core is installed, the menu is called OG AI Core and Lightbox is listed with your other OG plugins. The screen is at wp-admin/admin.php?page=oglb_settings and needs an administrator account.

The screen has these tabs:

Tab What it holds
Basics How the lightbox looks, its features, and which photo details it shows.
Advanced Image detection, performance, maintenance, behaviour and troubleshooting.
Diagnostics Checks that your visitors can load the photo information.
Location Map Map provider settings. This tab appears only when Location Map is on.
License Your licence key.

Settings save themselves as soon as you change them.

Settings

Basics: Look

Setting What it does Default
Theme The style of the lightbox: Dark Glass (Default), Light Glass, Plain Dark, Flat Dark or Flat Light. Dark Glass
Orientation Only for the two Flat themes. Puts the caption Below the image or Aside (next to it). Below
Backdrop How see-through the background is, from 0% (transparent) to 100% (solid). 85%
Toggle Animation The animation when the lightbox opens and closes: None or Zoom In / Zoom out. None
Animation Speed Shown when an animation is chosen. From Very Fast to Very Slow. Normal

A live preview next to these settings shows how the lightbox will look.

Basics: Features

These are grouped in folding sections.

Display

  • Fullscreen: shows a button that switches the browser to fullscreen.
  • Start in Fullscreen: opens the lightbox in fullscreen straight away. Tick Desktop, Mobile or both.
  • Magnification: lets visitors zoom into the image on hover and click. On by default.

Slideshow (needs a licence)

  • Slideshow: shows a button that starts a slideshow.
  • Autoplay: starts the slideshow as soon as the lightbox opens.
  • Timer (seconds): how long each image stays on screen.

Linking (needs a licence)

  • Deep Linking: while the lightbox is open, the page address changes to point at the current image. Anyone who opens that link sees the lightbox on the same image.
  • Slug: the word used in that link. The default is oglb, so a link looks like https://example.com/my-page/#oglb-123.
  • Social Sharing: adds a share button to the lightbox.
  • Platforms: choose Facebook, Twitter/X and Pinterest.

Other

  • Download Link: adds a button to open and download the original photo.
  • Location Map (needs a licence): shows a small map of where the photo was taken, when the file has GPS data. Clicking the map enlarges it to fill the lightbox. Turning this on also adds the Location Map tab.

Basics: Photo details

Choose which details appear under each image. Each group's title shows what is switched on.

Group Settings
Title Title: show the image title.
Caption Caption: show the caption. Then Caption Origin picks the text: Caption (Default) or Description. Caption Ellipsis shortens long captions.
Camera Info Camera, Lens, Shutter, Aperture, Focal Length and ISO.
Credits Copyright and Author.
Date & Keywords Date, Time, Timezone and Keywords.
Features Metadata Toggle adds a button so visitors can hide the details panel. Start Hidden hides the panel when the lightbox opens.

OG Lightbox reads these details from the image's EXIF data and from the media item in your Media Library. Camera and lens names are tidied up for common models, and empty values show as "N/A".

Advanced: Images

Setting What it does
Selector CSS selectors for the areas where the lightbox works. Default: .entry-content, .gallery, .oggl-root, .wp-block-gallery, .wp-block-image.
Anti Selector CSS selectors for images the lightbox must skip. Default: .blog, .archive, .emoji, .attachment-post-image, .no-lightbox.
Image Size Which size opens in the lightbox: Responsive Images (src-set) (recommended), Thumbnail, Medium, Large or Full.
Original Images Shows the original upload instead of the copy WordPress scales down for very large images.
Include Orphans Also opens images that are not in your Media Library, such as images from another site. These have no EXIF details.
Aggressive Resolve Tries harder to match images that WordPress does not recognise to a Media Library item. This can slow pages down.

Advanced: Performance

Setting What it does
Cache Tick Disable to stop caching photo details. While caching is on, a Reset cache button clears the stored details.
Output Buffering Reads the whole page instead of only the post content, so images outside the content are found too. This can slow very large pages.
Dynamic Rendering Delay (ms) The lightbox watches for images that appear after the page loads (sliders, infinite scroll, filters). This is how long it waits before it picks them up. Set it to 0 to switch watching off. Default: 300.
Dynamic Fetch Shown when the delay is above 0. Tick Disable to stop the lightbox asking your site for the details of images that appear later. They still open, but without EXIF details.
Parsing Engine How the page HTML is read: HtmlDomParser (Default) copes best with untidy HTML; DiDom is faster.
CDN Support If your images are served from a CDN, enter the source URL (leave empty for your uploads folder) and the CDN URL, so the lightbox can match CDN images to your Media Library.

Advanced: Maintenance

  • Export Options downloads your settings as a file.
  • Import Options loads settings from such a file.
  • Reset Options puts every setting back to its default.

Advanced: Behaviour

Setting What it does
Right Click Tick Allow to let visitors right-click images in the lightbox. It is off by default, which makes saving images harder but will not stop a determined visitor.
Separate Galleries Each gallery on a page gets its own lightbox, so the arrows only move through that gallery.
Hide Arrows on Mobile Hides the arrows on phones; visitors swipe instead. Needs a licence.

Advanced: Troubleshooting

Setting What it does
Debug Logs Writes what the plugin does to a log file. A Logs box then appears with Refresh Logs and Clear Logs.
JS Logs Writes debug messages to the browser console.
RTL Fix Fixes the slider for right-to-left languages.
Selector Ahead (In Revision) Applies the selectors on the server instead of in the browser. Still being revised.
Low-Res First (In Revision) Shows a low-resolution image while the full image loads. Still being revised.

Diagnostics

Click Diagnose to test whether your visitors can load photo details. The checks are:

  • REST API (from your browser)
  • Lightbox Endpoint (anonymous)
  • EXIF Request (exactly what your visitors do)
  • EXIF Request (as you, logged in)

Each check says what is wrong and how to fix it. The Detailed Checks and Environment sections show more. Copy report for support copies everything so you can send it to us. If the checks fail and you cannot fix the cause, Disable Dynamic Fetch turns that feature off for you.

Location Map

This tab appears when Location Map is on.

Setting What it does
Default Engine The map provider: Google Maps, MapBox, MapTiler or OpenStreetMap (for development only).
Default Zoom The zoom level. What a number means depends on the provider. Default: 12.
Token Your API key or token for the chosen provider. Each provider's section links to where you get one.
Style Google Maps: a style in JSON (leave empty for the default style). MapBox: your username and style ID.
Map Type Google Maps only: Roadmap, Satellite (default), Hybrid or Terrain.

License

Paste your licence key and validate it. This unlocks the features marked "needs a licence" above.

Common tasks

Stop the lightbox on one image

  1. Edit the page or post.
  2. Select the image block and open Advanced in the block settings.
  3. Add no-lightbox to Additional CSS class(es).
  4. Update the page.

Use the lightbox in another part of your theme

  1. Open Advanced > Images.
  2. Add the CSS class of that area to Selector, after a comma. For example: .entry-content, .gallery, .my-portfolio.
  3. If the area is outside the post content, turn on Output Buffering in Advanced > Performance.

Show where photos were taken

  1. Get an API key or token from Google Maps, MapBox or MapTiler.
  2. In Basics > Features > Other, turn on Location Map.
  3. Open the new Location Map tab, pick the Default Engine and paste the Token.
  4. Open a photo that has GPS data on your site. The map appears in the lightbox.

Read a photo's location again

When Location Map is on, each image in the Media Library has an OG GPS box showing the coordinates found in the file, with Open on Google Maps. If you change the GPS data in the file after uploading it, reset the stored location.

  1. Open the image in Media > Library (the edit screen, not the pop-up).
  2. In the OG GPS box, click Reset GPS Data.
  3. The coordinates are read again from the file the next time they are needed.
  1. Turn on Deep Linking in Basics > Features > Linking.
  2. Open a photo in the lightbox and copy the address from the browser bar.
  3. Anyone who opens that address sees the same photo in the lightbox.

FAQ and troubleshooting

The lightbox does not open

  • Check that the image is inside one of the areas in Selector, and not inside one in Anti Selector.
  • If the image is outside the post content, turn on Output Buffering.
  • If the image is not in your Media Library, turn on Include Orphans.

Photos open but the EXIF details are missing

  • Run Diagnose on the Diagnostics tab. A firewall, security plugin or CDN may be blocking /wp-json/og-lightbox/. Allow that path.
  • Make sure your permalinks are not set to Plain. If they are fine, go to Settings > Permalinks and click Save once.
  • Your server needs the PHP exif extension. The plugin shows a warning in wp-admin if it is missing. Ask your host to enable it.
  • The file may have no EXIF data. Some image editors and upload tools remove it.

I changed a photo but the lightbox shows old details

Editing an image in the Media Library clears its stored details. If something still looks old, click Reset cache in Advanced > Performance.

No. OG Lightbox works with WordPress galleries and image blocks. It also works with OG Gallery out of the box.

Uninstalling

Deactivating or deleting OG Lightbox does not remove its data. Your settings, the stored location and lens details on your images, and any cached photo details stay in the database. If you turned on Debug Logs, a log file named oglb_ followed by random letters stays in your uploads folder.

For developers

Hooks, REST routes, JavaScript functions and stored data are in the developer's guide.