2013-08-07 71 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个图像,并将其中一个图像放入您的页面。上述功能可以指定“小”,“中”,“大”使用的图像。