Opened 15 years ago
Closed 15 years ago
#12146 closed defect (bug) (fixed)
Post thumbnails should not be affected by $content_width
Reported by: | Viper007Bond | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Post Thumbnails | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
set_post_thumbnail_size( 940, 198, true ); $content_width = 640; the_post_thumbnail();
Outputs something like this:
<img width="640" height="134" src=".../filename-940x198.png" class="attachment-post-thumbnail wp-post-image" alt="" title="title" />
Note that the thumbnail is being generated correctly, but the HTML width/height is being affected by $content_width
. This should not happen. If a theme author wants it to not be wider than the theme width, then they wouldn't have set the width to be wider. Post thumbnails can be used outside of the content area.
Attachments (2)
Change History (7)
#2
@
15 years ago
- Keywords needs-testing added
Do only post thumbnails use $_wp_additional_image_sizes
?
#4
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Unintended side-effect: post thumbnail preview on write screen is not downsized to fit. The meta box is was setting $content_width
before to make it fit.
Rather than adding some other variable/global to replicate the old method, I think it'd just be easier to regex the HTML and modify the width/height.
Note: See
TracTickets for help on using
tickets.
A good example of this is the 2010 theme which uses a post's thumbnail as the header image in single post view.