OG Gallery¶
OG Gallery shows your photos in fast, responsive layouts. Add a gallery with the block, with a shortcode, or let it restyle the standard WordPress galleries you already have.
Requires: WordPress 6.0+ and PHP 8.1+. Product page: OG Gallery.
Who it's for¶
Photographers, travel bloggers, agencies and anyone who wants good-looking galleries that load quickly. It suits block editor users and page builder users alike, because every gallery can also be placed with a shortcode.
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.
- Open the License tab of the OG Gallery settings, paste your licence key and save.
The full steps are in Install and activate a plugin.
What the licence adds
The six main layouts, the block, the shortcodes and the Gallery Manager work as soon as the plugin is active. These need an active licence: the Carousel and Map (GPS Based) layouts, animations, collections, infinite scroll, Loading Style, Skeleton Loading (BETA) and turning off the Gallery Shortcode Override. In the settings, these options are greyed out until the licence is active.
Where to find it¶
- Settings: in the WordPress menu, open OG AI Core (or OG Nexus when OG AI Core is not installed), then Media > Gallery. The screen address is
wp-admin/admin.php?page=oggl_settings. - Block: in the block editor, add the OG Gallery block.
- Gallery Manager and Collection Manager: in the settings, on the Galleries & Collections tab.
Settings¶
Settings save as you change them. The screen has six tabs: Basics, Layouts, Pro Layouts, Galleries & Collections, Advanced and License.
Basics: Defaults¶
These apply to every gallery that does not set its own value.
| Setting | What it does |
|---|---|
| Layout | The default layout: Tiles, Masonry, Justified, Square, Cascade, Horizontal, Carousel or Map (GPS Based). Carousel and Map need a licence. The plugin starts on Tiles. |
| Link | Where a click on an image goes: None, Media File (the full image file) or Attachment Page. With None, an image still links if it has its own link set by OG Gallery Custom Links. |
| Animation | How images appear: None, Zoom Out, Zoom In, Fade Out, Fade In, Colorize or Highlight. Needs a licence. |
You can override any default in a single gallery. For example: [gallery layout="masonry" animation="zoom-out"].
Basics: Interface¶
| Setting | What it does |
|---|---|
| Caption Source | Which image field becomes the caption: Title, Caption, Description or Alt Text. |
| Captions | When captions show: None, On Hover or Always. |
| Captions Alignment | Left, Center or Right. Shown when captions are on. |
| Captions Background | None, Fade Black, Black, Fade White, White or Blur. Shown when captions are on. |
| Design Tool | Tick Enable to style every gallery image. Then set Border Radius (rounded corners in pixels), Border (width in pixels and a colour), Shadow Opacity (base and hover shadow, 0 to 1), Hover Lift (how many pixels an image rises on hover) and Transition Speed (in milliseconds). |
Basics: Speed¶
| Setting | What it does |
|---|---|
| Image Size | Which image file the gallery loads. Responsive Images (src-set) lets the browser pick the right size for each screen, and is the default. You can also force Thumbnail, Medium, Large or Full. |
| Truncate on Listing Pages | On by default. On archive and listing pages (not the single post), only the first few images of each gallery are shown. |
| Truncate Count | How many images to show on listing pages. The default is 4. Set it to 0 to hide galleries on listing pages completely. |
| Use Attachments On Empty | When a gallery ends up empty, show the images attached to the current post instead. |
| Gallery Shortcode Override | Tick Disable to stop OG Gallery from taking over the standard WordPress [gallery] shortcode. Your [og-gallery] shortcodes keep working, but galleries made with the OG Gallery block use [gallery], so they go back to the standard style too. Needs a licence. |
| Skeleton Loading (BETA) | Shows placeholders while images load, so the page does not jump. Needs a licence. |
| Right Click | Tick Allow to let visitors use the right-click menu on gallery images. When it is off, visitors cannot open the right-click menu on gallery images or drag them. Other images on the page are not affected. Needs a licence; without one, nothing is blocked. |
Basics: Infinite Scroll¶
All three need a licence.
| Setting | What it does |
|---|---|
| Infinite Scroll | Loads the first 12 images, then more as the visitor scrolls. Works with Tiles, Masonry, Justified, Square and Cascade. |
| Infinite Buffer | Starts loading images this many pixels before they come into view. 400 to 600 loads about one or two extra rows ahead. |
| Loading Style | What shows while more images load: None, Spinner, Single Skeleton, Single Skeleton (Dark), Button Loader and more. |
Layouts¶
One card per layout. Gutter is always the space between photos, in pixels.
| Layout | Settings |
|---|---|
| Tiles | Gutter for desktop, tablet and mobile. Density (Low, Medium, High) for desktop, tablet and mobile. Higher density means more, smaller tiles. The defaults are high, medium and low. |
| Masonry | Gutter, Columns (ideal number of columns, default 3) and Left to Right, which orders images across each row instead of down each column. |
| Justified | Gutter, Row Height (ideal row height in pixels, default 200) and Density for desktop, tablet and mobile. |
| Square | Gutter and Columns (default 5). |
| Cascade | Gutter. |
| Horizontal | Gutter, Height (in pixels, default 500), Hide Scrollbar, Scroll Warning (tells visitors there are more images) and Native Horizontal Scroll (scroll sideways with the mouse or trackpad instead of the vertical scroll; depends on the browser). |
Pro Layouts¶
This tab needs a licence.
Carousel
| Setting | What it does |
|---|---|
| Gutter | Space between the photos. |
| Height | Height of the carousel in pixels. |
| Compact | Puts the navigation and captions inside the carousel. |
| Immersive Captions | Uses the current image as the caption backdrop. Works best with Compact. |
| Arrow Navigation | Adds previous and next arrows. |
| Dot Navigation | Adds one dot per slide. |
| Thumbnail Navigation | Adds small previews of each slide. |
| Keep Aspect Ratio | Keeps each image's shape. Otherwise images are sized to fit the carousel. |
| Autoplay | Adds a button that starts a slideshow. |
| Infinite | Lets the carousel use infinite scroll, when Infinite Scroll is on. |
Map
The Map layout places photos on a map using the GPS data stored in each image.
| Setting | What it does |
|---|---|
| Default Engine | Google Maps, MapBox, MapTiler or OpenStreetMap. |
| Row Height | Height of the map in pixels. |
| Map Zoom | Starting zoom level. |
| Token | One for each of Google Maps, MapBox and MapTiler. Paste the API token from that map service. OpenStreetMap needs no token. |
| Style | Google Maps and MapBox only. Paste that service's style settings (a JSON style for Google Maps). |
Tip
Photos without GPS data do not appear on the map. Check that your camera or phone saves the location, and that the location is not removed when you export or optimise the image.
Galleries & Collections¶
This tab holds two managers.
- Gallery Manager: create galleries once and place them anywhere with a short shortcode. Useful for page builders that do not support blocks. Each gallery has a name, a description, a layout and an order. Its images come from Medias (you pick them) or Dynamic (the featured images of chosen Post IDs, your Latest Posts, or images with given Tags). For carousels made from posts, Hero Mode shows the post title and excerpt on top of each image and links to the post. Each gallery can have a lead image, chosen with Select a Lead Image.
- Collection Manager: group several galleries into one collection. Visitors see the collection as a set of covers and open each gallery from there. Collections need a licence.
Use Search... to find a gallery, Edit or Delete to change one, and Move up (increase rank) or Move down (decrease rank) to reorder the list.
Advanced: Maintenance¶
| Control | What it does |
|---|---|
| Debug Logs | Writes OG Gallery messages to the browser console. Keep it off on a live site. |
| Reset Options | Puts every setting back to its default. |
| Export Options | Downloads your settings as a file. |
| Import Options | Loads a settings file. The page then reloads. |
License¶
Paste your licence key here to unlock the features listed in What the licence adds.
Common tasks¶
Add a gallery with the block¶
- Edit a post or page and add the OG Gallery block.
- Pick or upload your images. You can also tick Use Attachments to show the images attached to the post, or pick a source: Manager's Galleries and Manager's Collections (saved in the managers) or OG Picture Core Folders (needs OG Picture Core).
- In the block's Gallery Settings, choose a Layout, Animation, Link To and Order By, or leave them on the defaults.
- Adjust Gutter, Columns, Row Height or Captions if that layout uses them. Custom CSS Classes adds your own classes.
- Save. The editor shows a short preview of up to 12 images. All images appear on the live page.
Restyle your existing WordPress galleries¶
- Activate OG Gallery.
- Open a page that already uses the
[gallery]shortcode. It now uses your default Layout. - To keep one gallery in the old WordPress style, add
og="false"to its shortcode:[gallery ids="1,2,3" og="false"].
Turn a block editor Gallery block into an OG Gallery¶
The standard Gallery block is not changed by OG Gallery. To switch one over:
- Select the Gallery block.
- Use the block toolbar's transform button and choose OG Gallery.
- Pick the layout in Gallery Settings and save.
Make a reusable gallery for a page builder¶
- Open Galleries & Collections and click Create a Gallery.
- Enter a Gallery Name..., choose a layout, and click Select Medias to pick the images.
- Save, then copy the shortcode it gives you.
- Paste the shortcode into a Shortcode widget or text block in your page builder.
- To change the gallery later, edit it in the Gallery Manager. Every page that uses it updates.
Show your latest posts as a carousel¶
- You need an active licence.
- Click Create a Gallery and switch the source to Dynamic.
- Choose Latest Posts and enter how many posts to show.
- Pick the Carousel layout and tick Hero Mode.
- Save and place the shortcode at the top of your page.
Build a photo map¶
- You need an active licence.
- Open Pro Layouts, choose a Default Engine and paste its Token.
- Add a gallery with images that contain GPS data and set its layout to Map (GPS Based), or use
[gallery ids="1,2,3" layout="map"].
FAQ and troubleshooting¶
My gallery says "The gallery is empty."¶
No images were found for that gallery. Check the image IDs, tags or posts you used. If the gallery uses attachments="true", the post has no attached images. Turn on Use Attachments On Empty if you want empty galleries to fall back to the post's attached images.
I see "This ID wasn't found in the Gallery Manager."¶
The id in the shortcode does not match a saved gallery. It may have been deleted. Copy the shortcode again from the Gallery Manager.
I see "The layout … is not available in this version."¶
That layout needs a licence (Carousel and Map), or its name is misspelt in the shortcode.
Galleries only show four images on my blog page¶
That is Truncate on Listing Pages. Open the full post to see every image, raise Truncate Count, or turn the setting off.
Clicking an image opens the file, but I want a lightbox¶
OG Gallery works with any lightbox. Set Link to Media File and install a lightbox such as OG Lightbox.
I see an error about pcre.backtrack_limit¶
The gallery is very large. Ask your host to raise the PHP pcre.backtrack_limit setting, or split the gallery.
Can I go back to the normal WordPress gallery?¶
Yes. Deactivate OG Gallery and your [gallery] shortcodes show in the standard WordPress style again. The OG Gallery block saves a [gallery] shortcode in your post, so those galleries fall back to the standard style too. Nothing in your posts is rewritten.
Uninstalling¶
OG Gallery has no uninstall routine. When you deactivate or delete it:
- Your posts keep their
[gallery]shortcodes, including the ones saved by the OG Gallery block. WordPress shows standard galleries again. - Galleries that use
[og-gallery]or[og-collection]stop working and show the raw shortcode. - The settings and the saved Gallery Manager galleries and collections stay in the database. Reinstall the plugin and they come back.
For developers¶
Hooks, shortcode attributes, REST routes and storage are in the developer's guide.