I applied image captions using Media (also title, alt text and description), yet there’s nothing showing in WP Featherlight’s lightbox. Any idea why? It’s showing only when adding the caption from the gallery block on each individual image, which is something I rather avoid doing, it’s easier adding directly from Media.
Found this related code, but it doesn’t work (added as Hook Element on the entire site).
to the best of my knowledge WP Featherlight uses Javascript to simply clone the HTML ( of the image you click on ) – so for the Caption to be displayed it has to be part of that markup.
But the core Gallery Block should auto add the caption if there is one attached to the image ?
It does on the latest version of WP for me.
You’re right, now I see the issue. The images don’t have captions yet, but the gallery blocks containing those image are already created. If I place a caption in Media to an image that’s part of the gallery already created, it doesn’t update the caption’s respective image in that gallery block. That is why I didn’t see the captions. Can this be fixed somehow?
That core block isn’t dynamic – in the sense that it saves what you add to the page and after that it has no relationship to the media attachments meta. So it looks like you have to manually update each image in the gallery or add a new gallery to the page.