php - Wordpress get attachment image caption -


i tried attachment meta caption value mentioned here, couldn`t output. other meta arrays [created_timestamp] or [iso] gave values.

$img_meta = wp_get_attachment_metadata( $id ); echo $img_meta[image_meta][caption]; 

this issue happens both [caption] , [title]. appreciated.

the caption , title looking wp_get_attachment_metadata not title , caption add in wordpress meta data actual image itself. wordpress data use (assuming $id id of image).

$image = get_post($id); $image_title = $image->post_title; $image_caption = $image->post_excerpt; 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -