WordPress at a glance

set_post_thumbnail_size() WP 1.0

Registers an image size for the post thumbnail.

Works based on: add_image_size()

No Hooks.


Null. Nothing.


set_post_thumbnail_size( $width, $height, $crop );
Image width in pixels.
Default: 0
Image height in pixels.
Default: 0
Whether to crop images to specified width and height or resize. An array can specify positioning of the crop area.
Default: false


  • See: add_image_size() for details on cropping behavior.


Since 2.9.0 Introduced.

Code of 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 );

From tag: Thumbnail (images)

More from category: Thumbnails

No comments
    Log In