WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 3 years ago

#28325 closed feature request (duplicate)

Set featured image size and differ per post type

Reported by: Bike Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9
Component: Media Keywords: needs-patch
Focuses: ui, template, performance Cc:
PR Number:

Description

Hi, would it be possible to expand this function:
http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size

so a post type can be added as a parameter? That way we can add custom functions that would allow different featured images sizes to be set for posts vs pages vs CPT's etc., as often these have different layouts and size requirements. Currently all featured images are the same size, usually over/undersized (and rescaled in CSS), which is a waste of bandwidth and often degrades the images.

Connected with this: it should be possible to choose not only the image, but also the image size when setting a featured image. I can specify my media settings to include, say, a 700px as Medum size, so it will be perfect for my theme as featured image, but there is no option to select this, always the largest (original) version is set.

This can be changed with the above function, (but only global, not per post type), but it would be better if a size simply could be chosen (original, large, medium etc).
Thanks for considering.

Change History (4)

#1 @johnbillion
6 years ago

  • Type changed from enhancement to feature request

Related: #13372

#2 @wonderboymusic
5 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

#3 @chriscct7
4 years ago

  • Version changed from 3.9.1 to 3.9

#4 @swissspidy
3 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

There's more traction on #13372, which is basically about the same (image sizes depending on post type) and could include set_post_thumbnail_size() as well.

Note: See TracTickets for help on using tickets.