Using with resized images
-
Hi,
I’m using a variation of the function found here:
https://oikos.org.uk/2011/09/tech-notes-using-resized-images-in-wordpress-galleries-and-lightboxes/
function daveys_get_attachment_link_filter( $content, $post_id, $size, $permalink ) { // Only do this if we're getting the file URL if (! $permalink) { $fullimage = wp_get_attachment_image_src( $post_id, 'full' ); $largeimage = wp_get_attachment_image_src( $post_id, 'large' ); $new_content = str_replace ( $fullimage[0] , $largeimage[0] , $content ); return $new_content; } } add_filter('wp_get_attachment_link', 'daveys_get_attachment_link_filter', 10, 4);
It resizes the image to be used in the lightbox, it doesn’t strip any tags from the
<a>
or<img>
elements.My problem is that only Alt text is being shown in the lightbox. I’m missing title and caption / description.
I’ve been trying to fix this for a few hours now but I’m getting nowhere. Any help would be greatly appreciated.
Davey
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Using with resized images’ is closed to new replies.