2013-08-07 101 views

回答

0

在圖像中的代碼所示:

// has_post_thumbnail() - boolean 
get_the_post_thumbnail($id, $size, $attr) // gets any thumbnail 

the_post_thumbnail($size, $attr) // for use inside the loop 
// demand a custom featured image size on upload for a custom post type. 
add_image_size('review_type', 245, 245, true); 
// call that size 
the_post_thumbnail($size, $attr) // for use inside the loop 

當媒體庫上傳你可以選擇上傳圖像的大小。然而,WP在上傳時會創建3個圖像,並將其中一個圖像放入您的頁面。上述功能可以指定「小」,「中」,「大」使用的圖像。