dsadsa123111
2013-02-05 18:26
浏览 35
已采纳

Wordpress调整大小图像并在帖子中显示为拇指

I have set crop in functions.php to resize Images for Posts.

Codex from Wordpress: 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?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongyaxiao5884 2013-02-05 18:30
    已采纳

    Wordpress will only resize images on upload, you can use this plugin to resize images on the fly, so the first time you call an image size that does not exists, this plugin will resize the image so the next times image size will exist.

    已采纳该答案
    打赏 评论

相关推荐 更多相似问题