The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Multiple Post Thumbnails
[resolved] Caption (3 posts)

  1. Gregg Franklin
    Posted 3 years ago #

    How can I display the caption for the newly created feature image?


  2. Oleksiy
    Posted 3 years ago #

    The same for me, the images do not have attribute title="", although i write it in caption field in Wp media manager. How can i add title to image???

    thank you in advance!

  3. Chris Scott
    Plugin Author

    Posted 3 years ago #

    You can use a WordPress core filter to do this:

    add_filter('wp_get_attachment_image_attributes', function($attr, $attachment){
    	$attr['title'] = trim(strip_tags( $attachment->post_excerpt ));
    	return $attr;
    }, 10, 2);

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Multiple Post Thumbnails
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic