I am trying to adjust the custom lightbox Wordpress Gallery structure into what I need for my layout. I want to insert a div inside the a-tag, on the same level as the img. By default, Wordpress uses $link to fetch the img, already inside the a-tag, so I would have to be able to fetch these seperately so I can attach my div inside the a-tag.

This is what Wordpress uses to fetch the link:

isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);

How can I split this up to get the necessary a-tag and img seperately?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.