Replacement for Jetpack Tiled Galleries and Lightbox Carousel

Jetpack has long suffered from mild to moderate derision in the WordPress developer community due to its bloated nature and heavy-handed approach. I don’t generally ride that bandwagon, but that may be changing.

SKIP TO THE RECIPE

We’ve added Jetpack on most of the sites we’ve build over the last decade, mainly for two feautures: Jetpack Stats and the Tiled Galleries with a Lightbox Carousel. The stats were an easy, quick snapshot for clients to view trends – rather than having to log into Google Analytics and wade through the confusion that GA is (just my opinion). And the tiled galleries have always looked nice, played well with the media library, and didn’t over complicate things with tons of options or an additional sidebar section. They looked good and they worked. Easy easy.

In the last few months, Jetpack has started requiring a paid subscription to use the stats extension, and since it’s always been more of a nice-to-have than a necessity, I’ve been deactivating it across the sites we mange. With the tiled galleries the only thing left that we’re using, it was time to find a replacement. 

Searching for a Tiled Gallery Replacement

For the past few months I’ve been on a mild onagainoffagain search to replace the titled galleries that come with Jetpack. There was a plugin that attempted to pull the code straight out of Jetpack that apparently worked for a while. I considered fixing the plugin or writing my own. I looked at a wide variety of ‘robust’ plugins that did all the fancy crazy gallery stuff. In the end I did found a simple solution that should work for most people: A lightweight combo of core WP functionality and a simple plugin:

Core Gallery Block

WordPress comes with a core gallery block that looks pretty nice. It tiles images out of the box and comes with a minimal set of options. In general this is exactly what I was looking for – a simple tiled gallery without a ton of bloat. No sidebar no complicated settings. And no shortcode insert. When editing a page, click the blue plus button and search for “gallery”. Add it to the page and add images as you normally would. A nice tiled gallery will appear with a few manageable options.

Lightbox with Photoswipe

I initially built a tiny script to add the Photoswipe javascript library to the theme. It mostly worked. There were a few minor issues with image sizing incorrectly and not keeping aspect ratios. A quick search of the plugin repo turned up Lightbox with Photoswipe that does what my script did, did it better, and without errors. There’s a manageable set of options and in the end, just simply worked. And someone else (Arno Welzel) keeps it updated with the latest version of Photoswipe. Nice.

Putting it all Together

There really isn’t much to configure. You do need to set the Gallery Block to link to the media file. The plugin finds all galleries and images and adds the script. I adjusted the background opacity and the max image width and height, and added a bit of padding.

I’ve since removed Jetpack Tiled Galleries and will go through the site and update any galleries to use the new setup.

TLDR

If you’re looking to ditch Jetpack but keep the tiled gallery / lightbox functionality, this is a good option:

  1. Use the WordPress Core Gallery block to create a gallery
  2. Installย Lightbox with Photoswipeย plugin
  3. Get this:

Leave a Reply

Your email address will not be published. Required fields are marked *

Ready for a refreshing experience on your next website design?