由于某种原因,当我使用WordPress 3.6.1媒体库GUI功能裁剪缩略图时,它似乎不会影响到我的投资组合页面上显示的缩略图?即使缩略图看起来像剪裁在后端,它仍然不正确地出现在投资组合页面上?
下面是从投资组合页面中摘录的代码。如您所见,它使用中等大小的缩略图。
<article class="post">
<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
<a href="<?php the_permalink(); ?>" rel="bookmark">
<figure>
<?php the_post_thumbnail('medium'); // Declare pixel size you need inside the array ?>
<?php endif; ?>
</figure>
<!-- /post thumbnail -->
<div class="cover">
<h2><?php the_title(); ?></h2>
<time pubdate="<?php the_date(); ?>"><?php the_date('Y-m-d', '<h2>', '</h2>'); ?></time>
</div>
</a>
</article>在functions.php中,我有以下内容:
// Add Thumbnail Theme Support
add_theme_support('post-thumbnails');
add_image_size('large', 700, '', true); // Large Thumbnail
add_image_size('medium', 250, '', true); // Medium Thumbnail
add_image_size('small', 120, '', true); // Small Thumbnail
add_image_size('custom-size', 700, 200, true); // Custom Thumbnail为什么我不能通过WordPress图形用户界面将我上传到媒体库的肖像图像裁剪成横向格式呢?
发布于 2013-11-19 10:43:32
有什么原因我不能裁剪我上传到媒体库的图片到景观格式?
因为没有指定高度,所以图像被裁剪到700 no宽(对于大图像),但是高度可以保持尽可能高(比例)。
假设您有一个图像700 it *1500 it,并且希望将它转换为langscape图像,那么您将需要以下大小:
add_image_size('large', 700, '200', true);根据您的喜好更改200。阅读更多:size
https://stackoverflow.com/questions/20060242
复制相似问题