2010-02-23 16 views
0
快速PHP函數

我的index.php有大約400像素WordPress的插件或有條件圖像尺寸

身體列寬的single.php中有大約550px

列寬是否有插件或快捷方式使所有圖像(不只是post_thumbnail) 在single.php上顯示完整大小(即image.jpg),但在index.php上使用縮略圖大小(即image-350x ***。jpg)?

回答

0

真的不知道你是如何展示你的圖像,但你可以試試...

在single.php中:

$img = wp_get_attachment_image($attachment_id, $size='full', $icon = false); 
echo $img; 

而就的index.php:

$img = wp_get_attachment_image($attachment_id, $size=array(350,250), $icon = false); 
echo $img; 
+0

結束只需使用全尺寸圖像並使用溢出進行裁剪:隱藏在CSS中。 – davidosomething 2010-02-26 20:49:29