Registers an image size for the post thumbnail.
$widthintrequired
$heightintrequired
$cropbool|arrayoptional
0 string'left' 'center', or 'right'.1 string'top', 'center', or 'bottom'.Default:false
add_theme_support( 'post-thumbnails' ); in its functions.php file. See also Post Thumbnails.function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) {
add_image_size( 'post-thumbnail', $width, $height, $crop );
}
| Version | Description |
|---|---|
| 2.9.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/set_post_thumbnail_size