How to show dynamic post content in a lightbox?

I’m using a query loop that has posts in it and when you click them, it should open a lightbox with the post content (the content is just images).

It doesn’t work and I’m not sure if I’m doing something wrong or if this is just broken.


I’m not sure about this, but what if you enter the “post_id” dynamic data in the Lightbox ID field?

Edit: You dont need to use the HTML tag to link but instead go to the section: “Link to” on the image element and link it to the lightbox there.

That dynamic field expects the URL to the image, not to the post content. Choose {featured_image} from dynamic data (if those images you showing are indeed featured images) and it will work :slight_smile:

I think you tried to do some type of mix between lightbox, when you just need to call an image, and popup AJAX petition, when you can call all post data and show one or more fields from that post.

My client has a Portfolio page where she wants people to click on each project’s image and have a lightbox gallery appear.

I tried to do this by putting an image gallery in each post and then have the lightbox dynamically call up that the post content in the hope that it would show the gallery.

It looks like this isn’t possible then?

There are a couple of ways to to it.

I think the simplest is to create an AJAX Popup and load the gallery inside: Popup Builder – Bricks Academy

Hello Laura :wave:

Let’s see if this video I made helps you to achieve what you want - https://youtu.be/LsopZLonjUc?si=rxUYvDuQ2kJ_6w8O

There is a section where I explain super fast how to achieve it, in case you don’t have time to watch the whole video.

Love! :green_heart:

1 Like