Opened 17 years ago
Closed 16 years ago
#11913 closed defect (bug) (fixed)
post thumbnail isn't using resized images
| Reported by: | Denis-de-Bernardy | Owned by: | MarkJaquith |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Post Thumbnails | Version: | 2.9.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
it seems like the new post thumbnail feature neither crops images, nor uses thumbnail images when available.
get_the_post_thumbnail() and set_post_thumbnail_size() seem to use the size of post-thumbnail, but image_downsize() only seems to understand a size of thumbnail.
this results in huge images in posts, even when the size is small.
Change History (5)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
adding this code in a theme fixes the issue, in case anyone needs a temporary fix:
add_filter('image_downsize', 'my_thumbnail_downsize', 10, 3); $thumbnail = get_the_post_thumbnail(); remove_filter('image_downsize', 'my_thumbnail_downsize', 10, 3); ... function my_thumbnail_downsize($in, $id, $size) { if ( $in || $size != 'post-thumbnail' ) return $in; return image_downsize($id, 'thumbnail'); }