首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wordpress -停止特色图片被裁剪?

Wordpress -停止特色图片被裁剪?
EN

Stack Overflow用户
提问于 2013-12-26 21:01:13
回答 1查看 119关注 0票数 0

我如何阻止我的帖子的特色图片被裁剪?

这是我在functions.php上找到的最接近的代码:

函数thickbox_fields($form_fields,$post){ unset( $form_fields‘’image size‘);

代码语言:javascript
复制
$size = 'full';
$css_id = "image-size-{$size}-{$post->ID}";
$html = "<div style='display: none;' class='image-size-item'><input type='radio' name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'checked='checked' /></div>";
//set as image-size field
$form_fields['image-size'] = array(
    'label' => '', //leave with no label
    'input' => 'html', //input type is html
    'html' => $html //the actual html
);

return $form_fields;

谢谢!!

EN

回答 1

Stack Overflow用户

发布于 2013-12-27 02:22:27

代码语言:javascript
复制
  You should use following code in function.php:

      Syntax: add_image_size( $name, $width, $height, $crop );

      Example: add_image_size( 'homepage-thumb', 220, 180, false );

  If $crop is set to be "true" then it will be cropped.

  Try it and inform me what happened?
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20785343

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档