Function: set_post_thumbnail_size

set_post_thumbnail_size( integer $width, integer $height, boolean | array $crop )

Registers an image size for the post thumbnail.

Parameters

Name Type(s) Default Value Description
$width integer

Image width in pixels.

$height integer

Image height in pixels.

$crop boolean | array false

Optional. Whether to crop images to specified width and height or resize. An array can specify positioning of the crop area. Default false.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.