1

我需要帮助查找在何处以及如何更改帖子中特色图像的大小和裁剪。我查看了functions.php 和init.php,但没有成功。我正在使用 inLine 主题的子主题。

当前高度设置为 130 像素。

我试过改变css,但这只会拉伸图像。

4

2 回答 2

3

在functions.php中执行此操作:

add_image_size( 'name-of-your-image-size', 600, 300, true );

或者,如果您更愿意使用插件-

http://wordpress.org/extend/plugins/additional-image-sizes-zui/

然后在您的帖子中,像这样在您的 single.php 或循环中检索它:

<?php the_post_thumbnail('name-of-your-image-size'); ?>
于 2011-10-20T17:24:20.783 回答
2

在您的functions.php中,粘贴其中之一并根据您的喜好调整像素宽度和高度:

set_post_thumbnail_size( 100, 100 ); // 100 pixels wide by 100 pixels tall, box resize mode

或者:

set_post_thumbnail_size( 100, 100, true ); // 100 pixels wide by 100 pixels tall, hard crop mode
于 2011-10-20T17:04:14.647 回答