WordPress at Your Fingertips

set_post_thumbnail_size() WP 1.0

Registers an image size for the post thumbnail.

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

Changelog

Since 2.9.0 Introduced.

Code of set_post_thumbnail_size() WP 5.8

<?php
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