为什么缺少附件显示设置?

问题描述 投票:0回答:1

我正在使用 elementor/astra 主题,目前我正在尝试为特色图像添加自定义尺寸,以便它们始终被硬裁剪。我将此代码添加到我的子主题functions.php中,它确实有效,因为我可以在生成缩略图插件中看到坟墓大小在那里,但我无法设置它,因为我没有附件显示设置选项在任何图像上。有没有办法让它显示出来,以便我可以从下拉列表中选择我的自定义尺寸?

    /*Custom Image Sizes */ 

add_image_size('tomb-size', 371, 271, TRUE); 


/* Display Custom Image Sizes */ 
add_filter( 'image_size_names_choose','redswanio_custom_image_sizes' );
function redswanio_custom_image_sizes( $sizes ) {
return array_merge( $sizes, array(
'tomb-size' => __( 'Cropped Tombstone' ),
) ) ;
}
php wordpress elementor
1个回答
0
投票

尝试添加这样的自定义图像尺寸

add_action( 'after_setup_theme', function() {
add_image_size( 'horiz-med', 800, 526, true );
add_image_size( 'vert-med', 800, 1050, true );
} );
© www.soinside.com 2019 - 2024. All rights reserved.