开发者

Wordpress Plugin or quick php function for conditional image size

my index.php has a body column width of about 400px

The single.php has a column width of about 550px

Is there a plugin or quick way to make all images (not just the post_thumbnail) display at full size (i.e., image.jpg) on single.php but use the thumbnail size (i.e., image-350x***.jpg) 开发者_如何学JAVAon index.php?


Dont really know how you are showing you images, but try something like...

On single.php:

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

And on index.php:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜