我需要提出三点缩略图一个WordPress的模板:我不能让100x120缩略图WordPress的
- 678x301像素
- 271x120像素
- 100x120像素
所以我有把这些放在functions.php:
<?php add_theme_support('post-thumbnails');
add_image_size('index-thumb', 271, 120, true);
add_image_size('featured', 678, 301, true);
add_image_size('sieme', 100, 120, true);
?>
但不幸的是,第三个不起作用。当我使用它时,它不链接到foo_100x120.jpg(它存在,我手动检查过),而是链接到foo.jpg并通过HTML设置宽度和高度。这里是带有单个视图的屏幕,我已经为测试添加了三个缩略图。 HTML是下面,在Firebug: http://i.stack.imgur.com/MCTM8.png
这里是single.php中的一部分:
<?php
if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail('featured');
the_post_thumbnail('index-thumb');
the_post_thumbnail('sieme');
}
?>
我不知道,为什么会发生。
上传图片时您是否拥有这3种尺寸?我想我读过的大拇指是在你上传时产生的,所以如果你没有最后的大小,那么你就不会那么大。 – Cmorales 2012-03-11 23:23:25