您好,我正在尝试在媒体设置中的大尺寸下添加新尺寸,但这不起作用,我已经研究了不同的文章,但肯定我遗漏了一些东西,请指导我。
This is what I am trying to achieve: http://prntscr.com/g2idly
add_theme_support( \'post-thumbnails\' );
add_image_size( \'featured-large\', 640, 294, true ); // width, height, crop
add_image_size( \'featured-small\', 320, 147, true );
add_image_size( \'medium-width\', 480 );
add_image_size( \'medium-height\', 9999, 480 );
add_image_size( \'medium-something\', 480, 480 );
add_filter( \'image_size_names_choose\', \'wpshout_custom_sizes\' );
function wpshout_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
\'medium-width\' => __( \'Medium Width\' ),
\'medium-height\' => __( \'Medium Height\' ),
\'medium-something\' => __( \'Medium Something\' ),
) );
}
这是我试图输入和测试的代码,但什么都没有发生。