[英]Wordpress Resize Image and show as thumb in post
I have set crop in functions.php to resize Images for Posts. 我在functions.php中设置了crop以调整帖子图像的大小。
Codex from Wordpress: add_image_size , post_thumbnail 来自Wordpress的Codex: add_image_size , post_thumbnail
add_theme_support('post-thumbnails');
set_post_thumbnail_size(100, 100, true); //size of thumbs
add_image_size( 'post-thumb', 180, 180, true ); //(cropped)
Usage is like below 用法如下
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'post-thumb' ); } ?>
But it will not resize the thumb and shows the original size. 但是它不会调整拇指的大小并显示原始大小。 What am I doing wrong? 我究竟做错了什么?
WordPress只会在上载时调整图像大小,您可以使用此插件动态调整图像大小,因此第一次调用不存在的图像大小时,此插件将调整图像大小,以便下次存在图像大小时。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.