12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Nov 18, 2019

Posts Grid Lightboxes in Oxygen

Sridhar Katakam

This members-only tutorial provides the steps to show post-specific information like title and excerpt in a lightbox using GLightbox when the featured image is clicked for each post in an Easy Posts grid with left/right arrows + keyboard navigation inside the lightbox in Oxygen.

Live Demo
(scroll down to Portfolio section)

We shall

  • use a default/fallback image for posts that do not have a featured image.
  • add a dark overlay and magnifying glass svg icon on image hover.

Step 1

Let us define a custom image size for the images in our lightbox posts grid.

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: Custom Image Sizes

Code:

add_image_size( 'grid-lightbox-image', 900, 650, true );

For a uniform grid (unlike in the demo site), you might want to ensure that all the featured images have the same dimensions as in the above snippet. Replace the width and height values as needed.

Add another Snippet.

Title: Custom Excerpt

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-ocalendar-check-omagnifiercrossmenuchevron-downarrow-right