我正在使用WP_Customize_Cropped_Image_Control
供用户在自定义程序中上载和裁剪图像。然而,get-theme-mod函数似乎并不像我通常做的那样用于输出它。
这是我在我的定制器。php文件:
$wp_customize->add_setting( \'bio_image\', array(
\'default\' => get_template_directory_uri() . \'/images/default.jpg\',
\'transport\' => \'postMessage\'
) );
$wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, \'bio_image\', array(
\'label\' => __( \'bio_image\', \'myTheme\' ),
\'flex_width\' => false,
\'flex_height\' => false,
\'width\' => 200,
\'height\' => 200,
\'settings\' => \'bio_image\',
) ) );
这是我的模板文件中的内容:<img src="<?php echo get_theme_mod( \'bio_image\' , get_template_directory_uri().\'/images/default.jpg\' ); ?>">
这仅显示default.jpg
图像,并且尺寸错误。是否有其他输出裁剪图像的方法?