动画GIF作为特色图像

时间:2015-07-23 作者:rxssmcdxwell

我想上传动画GIF到我的网站,并使用它们作为特色图片。我有几个问题。

首先。。。如何阻止wordpress在上载图像时自动调整图像大小,以及在将动画gif更改为静态gif的过程中自动调整图像大小?我已经在网上看过了它的教程,但大多数教程都说要确保在上传时单击“全尺寸图像”。然而,这在wordpress 4.2.3中似乎不是一个选项?

第二,现在动画GIF的替代品是什么?我知道这并不理想,它们可能会很笨重。但我使用的是电影图像,所以我觉得在我的特色图像中使用GIF很有吸引力。虽然我可能会为我的特色图片切换到静态GIF和动画GIF的组合,但我可能会同时加载多达20个GIF,我想这并不理想。我看过一些插件,有一个插件可以将动画GIF转换为html5。但是,它仅被下载<;40次,无评级。

1 个回复
SO网友:Matt van Andel

It is perfectly fine to use animated gifs in any capacity you like in WordPress, even as featured images. When you upload an image, WordPress will process it into various shapes and sizes, as specified by your theme and possibly some plugins as well.

The version of image that gets displayed is determined by your theme OR, if not specified, WordPress core (thumbnail = 150x150). The image is then displayed by the theme with the function the_post_thumbnail() - by default, this will use the \'thumbnail\' size, which is generally the smallest size available.

To ensure that your uploaded gifs are displayed as uploaded (without any processing), you need to modify the_post_thumbnail() in your theme templates to instead read the_post_thumbnail( \'full\' ). This will instead use the original image with no processing whatsoever.

结束

相关推荐