WordPress at a glance

set_post_thumbnail_size() WP 1.0

Registers an image size for the post thumbnail.

Notes:

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

No Hooks.

Return

Nothing (null).

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

Code of set_post_thumbnail_size: wp-includes/media.php VER 4.9.8

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

More from category: Thumbnails

No comments
    Hello, !     Log In . Register