您可以定义自己的post thumbnail sizes
add_theme_support( \'post-thumbnails\' );
set_post_thumbnail_size( 150, 150 );
这意味着您可以整体更改缩略图大小。
或者你可以define custom image sizes
add_action( \'after_setup_theme\', \'wpdocs_theme_setup\' );
function wpdocs_theme_setup() {
add_image_size( \'category-thumb\', 300 ); // 300 pixels wide (and unlimited height)
add_image_size( \'homepage-thumb\', 220, 180, true ); // (cropped)
}
可以这样称呼:
if ( has_post_thumbnail() ) {
the_post_thumbnail( \'category-thumb\' );
}