<?php
// First we'll add support for featured images
add_theme_support( 'post-thumbnails' );
// Then we'll add our 2 custom images
add_image_size( 'featured-large', 1600, 400, true );
add_image_size( 'blog-width', 800, 600 );
// And then we'll add the custom size that spans the width of the blog to the Gutenberg image dropdown
add_filter( 'image_size_names_choose', 'knaeckebrot_custom_image_sizes' );
function knaeckebrot_custom_image_sizes( $sizes ) {
return array_merge( $sizes, array(
'blog-width' => __( 'Blog Width' ),
) );
}
Quelle: https://premium.wpmudev.org/blog/wordpress-image-sizes/