1

我正在尝试使用 WP 函数 the_post_thumbnail(array(x,y)); 但图像无法正确调整大小。它只是无法正常工作。

特别是在我正在构建的 page-template.php 文件中,我正在尝试使用:

the_post_thumbnail( array(200,200) );

然而生成的图像是 200 x 150。我在这里缺少什么?

我尝试将缩略图大小显式添加到functions.php,如下所示:

add_image_size( 'news-feature-thumb', 200, 200, true );

但这并没有什么不同。

我查看了整个 StackOverflow,但我没有看到任何可以解决我的问题的东西。我正在使用 WP 3.3.1。这种方法是否已弃用?

4

1 回答 1

3

添加后add_image_size( 'news-feature-thumb', 200, 200, true );尝试这样调用the_post_thumbnail

the_post_thumbnail( 'news-feature-thumb' ); 
于 2013-04-17T22:45:37.537 回答