doujing1858
2016-07-08 08:48
浏览 43
已采纳

WordPress - add_image_size不起作用?

Following this guide, I want to add an additional image size:

if ( function_exists( 'add_theme_support' ) ) { 
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 150, 150, true ); // default Post Thumbnail dimensions (cropped)

    // additional image sizes
    // delete the next line if you do not need additional image sizes
    add_image_size( 'category-thumb', 500, 500 );
}

But I don't see this size (500 X 500) of image is created in /wp-content/uploads/... after uploading new images.

Any ideas what I have missed?

图片转代码服务由CSDN问答提供 功能建议

指南,我想添加一个额外的图像大小:

  if(function_exists('add_theme_support')){
 add_theme_support('post-thumbnails')  ; 
 set_post_thumbnail_size(150,150,true);  //默认后缩略图尺寸(裁剪)
 
 //其他图像尺寸
如果不需要其他图像尺寸,则删除下一行
 add_image_size('category-thumb',500,500); \  n} 
   
 
 

但是我没有看到这个尺寸(500 X 500)的图像是在 / wp-content / uploads /中创建的... 上传新图片后

我错过了哪些想法?

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

1条回答 默认 最新

  • ds1379551 2016-07-08 09:00
    已采纳

    Just add this code.

    if (function_exists('add_image_size')){
    add_image_size( 'category-thumb',500,500, true);
    
    }
    
    点赞 评论

相关推荐 更多相似问题