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 ($27/month or $169 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: