Use Image Caption Instead of Image Title
-
Hello all,
I needed the answer for this and it wasn’t posted. After some digging in the WordPress codex I found out the answer.
The title code is found in the current-post-list-images.php file on lines 72-74 (this is for version 1.6.1 of the plugin):
<br /> echo '<img src="'.$arr_image[0].'" '.<br /> (('true' == $parms['caption']) ? ' title="'.get_the_title($id).'"' : '').<br /> $thumbnail.'/>';
change this to:
<br /> $thecaption = apply_filters( 'the_caption', $image->post_excerpt );</p> <p>echo '<img src="'.$arr_image[0].'" '.<br /> (('true' == $parms['caption']) ? ' title="'.$thecaption.'"' : ''). //.get_the_title($id).'"' : '').<br /> $thumbnail.'/>';<br />
The first line of code grabs the caption info and stores it in the variable $thecaption. Image captions are stored as the image’s post_excerpt. Then we modify line 73 to show the info we have stored in $thecaption.
Hope this helps someone else out. Best wishes,
Brian Peterson
[email protected]
kismetwebdesign.com
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Use Image Caption Instead of Image Title’ is closed to new replies.