Adding caption to image link.
-
Hi I am trrying to integrate the image caption in the image href.
It’s getting a bit complicated for my skills!
here’s the code i need to modify in media.php:
<div class='gallery'>"); $i = 0; foreach ( $attachments as $id => $attachment ) { $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); $output .= "<{$itemtag} class='gallery-item'>"; $output .= " <{$icontag} class='gallery-icon'> $link "; if ( $captiontag && trim($attachment->post_excerpt) ) { $output .= " <{$captiontag} class='gallery-caption'> {$attachment->post_excerpt} </{$captiontag}>"; } $output .= "</{$icontag}></{$itemtag}>"; if ( $columns > 0 && ++$i % $columns == 0 ) $output .= '<br style="clear: both" />'; }
I know its in this part:
$link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
but I am not able to put my caption inthe $link…If somebody knows that would be great.
Thanks heaps.(if you’re wondering why I want this follow this link:css hover description
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding caption to image link.’ is closed to new replies.