Wordpress custom thumbnail size

后端 未结 2 1994
北海茫月
北海茫月 2021-01-22 01:31

I\'am trying to make custom thumbnail sizes in Wordpress. Currently I have following code in functions.php



        
2条回答
  •  迷失自我
    2021-01-22 01:39

    Thumbnail Sizes

    The default image sizes of WordPress are “thumbnail”, “medium”, “large” and “full” (the size of the image you uploaded). These image sizes can be configured in the WordPress Administration Media panel under Settings > Media. This is how you can use these default sizes with the_post_thumbnail():

    the_post_thumbnail();                  // without parameter -> 'post-thumbnail'
    
    the_post_thumbnail( 'thumbnail' );       // Thumbnail (default 150px x 150px max)
    the_post_thumbnail( 'medium' );          // Medium resolution (default 300px x 300px max)
    the_post_thumbnail( 'large' );           // Large resolution (default 640px x 640px max)
    the_post_thumbnail( 'full' );            // Full resolution (original size uploaded)
    
    the_post_thumbnail( array(100, 100) );  // Other resolutions
    

提交回复
热议问题