我有一个用于不透明度的主题选项。在屏幕上,我将0.67作为值。但如果我发布并刷新以查看值,它将显示为0-67。


这是我的代码:
$wp_customize->add_setting( \'mctheme_option_headernav_background_opacity\', array (
\'default\' => \'0.67\',
\'sanitize_callback\' => \'sanitize_title\',
\'type\' => \'theme_mod\',
));
$wp_customize->add_control(\'mctheme_option_headernav_background_opacity\', array(
\'type\' => \'text\',
\'label\' => esc_html__(\'Header/Navigation Background Opacity\', \'mctheme\' ),
\'section\' => \'colors\'
));
以及主题中使用的代码中使用的:
get_theme_mod(\'mctheme_option_headernav_background_opacity\', \'0.67\')
这有什么原因吗?我尝试将控件类型更改为数字,但也没有成功