Magnific Popup – Add Caption to Images

You have to add the title attribute to the <a href> code surrounding the images that the Magnific Popup effect is being applied to.

The new code should look like this:

$thumb_img = get_post( get_post_thumbnail_id() ); // Get post by ID
$excerpt = $thumb_img->post_excerpt; // Display Caption
<a href="https://wordpress.stackexchange.com/questions/178297/{current_url_here}" title="<?php echo $excerpt; ?>" />

It would be a lot easier for me to help you out if you could paste some sample code in your question 🙂

Hope this helps.