任何人都可以帮我修复wordpress 2011主题中自定义标题图片裁剪的宽高比,或者完全禁用裁剪吗?
在这个阶段我只需要完成它,即使这意味着修改核心文件。我用google搜索解决方案,但到目前为止还没找到。
谢谢!
答案 0 :(得分:3)
如果我很清楚你想做什么,我想你可以看看主题的functions.php文件。
你会看到以下几行:
// The height and width of your custom header.
// Add a filter to twentyeleven_header_image_width and twentyeleven_header_image_height to change these values.
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyeleven_header_image_width', 1000 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyeleven_header_image_height', 288 ) );
// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be the size of the header image that we just defined
// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
// Add Twenty Eleven's custom image sizes
add_image_size( 'large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Used for large feature (header) images
add_image_size( 'small-feature', 500, 300 ); // Used for featured posts if a large-feature doesn't exist
如果你想改变裁剪的行为,你只需要将* add_image_size()*函数的第三个参数设置为 false ,你可以在{{3}中看到它}
我希望这就是你想要的,如果没有,请告诉我;)