set_post_thumbnail_size() WP 1.0
Registers an image size for the post thumbnail.
Works based on: add_image_size()
No Hooks.
Return
Null. Nothing.
Usage
set_post_thumbnail_size( $width, $height, $crop );
- $width(int)
- Image width in pixels.
Default: 0 - $height(int)
- Image height in pixels.
Default: 0 - $crop(true/false/array)
- Whether to crop images to specified width and height or resize. An array can specify positioning of the crop area.
Default: false
Notes
- See: add_image_size() for details on cropping behavior.
Changelog
Since 2.9.0 | Introduced. |
Code of set_post_thumbnail_size() set post thumbnail size WP 5.6
function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) {
add_image_size( 'post-thumbnail', $width, $height, $crop );
}Related Functions
From tag: Thumbnail (images)
- add_image_size()
- delete_post_thumbnail()
- get_intermediate_image_sizes()
- get_post_thumbnail_id()
- get_the_post_thumbnail()
- get_the_post_thumbnail_caption()
- get_the_post_thumbnail_url()