Opened 3 years ago

Last modified 16 months ago

#12235 new feature request

Display caption with the_post_thumbnail

Reported by: hd-J Owned by:
Priority: normal Milestone: Future Release
Component: Post Thumbnails Version: 2.9
Severity: normal Keywords:
Cc: mikeschinkel@…, GlobalChange, xoodrew@…

Description

It seems to me that there could be room for improvement with the_post_thumbnail function. So far, I did not find any way to display the caption below the thumbnail, like we do today with "normal" images.

What do you think of the idea of adding an argument for displaying caption text with the thumbnail?

Attachments (2)

Original Featured php.doc (30.5 KB) - added by GlobalChange 17 months ago.
Original Function php.doc (47.5 KB) - added by GlobalChange 17 months ago.

Download all attachments as: .zip

Change History (14)

  • Cc mikeschinkel@… added

+1

  • Component changed from Embeds to Post Thumbnails
  • Milestone changed from Unassigned to 3.1
  • Milestone changed from Awaiting Triage to Future Release
  • Cc GlobalChange added
  • Keywords changed from the_post_thumbnail, caption, wp-caption-text to the_post_thumbnail caption wp-caption-text
  • Severity changed from minor to normal
  • Version set to 3.3.1

Old Ticket wondering where we are with this? This is an important function to ensure that wordpress users comply with copy right laws and provide sources for photos in captions for featured images.
Thank you

Replying to hd-J:

It seems to me that there could be room for improvement with the_post_thumbnail function. So far, I did not find any way to display the caption below the thumbnail, like we do today with "normal" images.

What do you think of the idea of adding an argument for displaying caption text with the thumbnail?

  • Keywords the_post_thumbnail caption wp-caption-text removed

For what it's worth, it's fairly simple to add a function to your theme to get the thumbnail caption:

function get_post_thumbnail_caption() {
	if ( $thumb = get_post_thumbnail_id() )
		return get_post( $thumb )->post_excerpt;
}

Then you can just do something along the lines of:

if ( has_post_thumbnail() ) {
	the_post_thumbnail( 'medium' );
	echo wpautop( get_post_thumbnail_caption() );
}

HI Added the code you suggested above and nothing happened. I attached my php code from the appearance editor for both the Featured.php and Function.php. Sorry I don't know much about coding. Can you include the code in the attached docs and reattach? Thank you very much and Warm Regards,

  • Version changed from 3.3.1 to 2.9
  • Version changed from 2.9 to 3.3.1

Hi I actually already downloaded version 3.3.1 however, I guess these php functions did not update or change when I updated my version from the updates panel. So it says that I am using the latest version and I am utilizing all the new features and taking advantage of the updated security features but, for some reason it's not reflected in the attached files.
Thank you
Kind Regards

  • Version changed from 3.3.1 to 2.9

The version field is used to indicate the first version in which a problem was identified in, or reproduced in.

comment:10 follow-up: ↓ 11   GlobalChange17 months ago

High What are next steps? Thank you

comment:11 in reply to: ↑ 10   globalchange17 months ago

Replying to GlobalChange:

Hi What are next steps? Thank you

Hi am wondering what the next step would be. Thank you

  • Cc xoodrew@… added
Note: See TracTickets for help on using tickets.