Opened 3 years ago
Last modified 16 months ago
#12235 new feature request
Display caption with the_post_thumbnail
| Reported by: |
|
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)
Change History (14)
comment:1
mikeschinkel — 3 years ago
- Cc mikeschinkel@… added
- Component changed from Embeds to Post Thumbnails
- Milestone changed from Unassigned to 3.1
comment:4
in reply to:
↑ description
GlobalChange — 17 months ago
- 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?
comment:5
johnbillion — 17 months ago
- 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() );
}
GlobalChange — 17 months ago
GlobalChange — 17 months ago
comment:6
GlobalChange — 17 months ago
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,
comment:7
SergeyBiryukov — 17 months ago
- Version changed from 3.3.1 to 2.9
comment:8
globalchange — 17 months ago
- 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
GlobalChange — 17 months ago
High What are next steps? Thank you
comment:11
in reply to:
↑ 10
globalchange — 17 months ago
Replying to GlobalChange:
Hi What are next steps? Thank you
Hi am wondering what the next step would be. Thank you
comment:12
DrewAPicture — 16 months ago
- Cc xoodrew@… added

+1