我在functions.php中启用了缩略图和大小:
add_theme_support( 'post-thumbnails' );
add_image_size( 'post-thumbnail', 150, 150, true );
add_image_size( 'featured-thumbnail', 360, 300, true );
它们在循环中被正确调用,虽然crop设置为true,但我还没有看到任何图像裁剪到指定的大小,它们都“看似”成比例。我每次做出改变都会重新生成缩略图,但没有任何效果。我已经搜索了很多答案,而且几乎没有修复(我不想使用插件并手动完成)。
有什么想法吗?
答案 0 :(得分:5)
请尝试这个:
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'post-thumbnail', 150, 150, true );// please give another name if its not major requirement of this
add_image_size( 'featured-thumbnail', 360, 300, true );// please give another name if its not major requirement of this
}
感谢。