set_post_thumbnail_size()
Registers an image size for the post thumbnail.
Uses: add_image_size()
No Hooks.
Return
null
. Nothing.
Usage
set_post_thumbnail_size( $width, $height, $crop );
- $width(int)
- Image width in pixels.
- $height(int)
- Image height in pixels.
- $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.9.3
function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) { add_image_size( 'post-thumbnail', $width, $height, $crop ); }