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

时间:2013-12-26 13:01:13

标签: wordpress

如何停止裁剪帖子的精选图片?

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

function thickbox_fields($ form_fields,$ post){     未设置(         $ form_fields [ '图像尺寸']     );

$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;

谢谢!

1 个答案:

答案 0 :(得分:0)

  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?