从customizer中,我希望获得选定范围值的值并显示该值,但运气不佳。对下面的代码有什么建议吗?
$wp_customize->add_setting( \'range_field_id1\', array(
\'default\' => \'\',
\'type\' => \'theme_mod\',
\'capability\' => \'edit_theme_options\',
\'transport\' => \'\',
\'sanitize_callback\' => \'intval\',
) );
$wp_customize->add_control( \'range_field_id1\', array(
\'type\' => \'range\',
\'priority\' => 10,
\'section\' => \'cta_primaryd_section2\',
\'label\' => __( \'Range Field\', \'textdomain\' ),
\'description\' => \'\',
\'input_attrs\' => array(
\'min\' => 1,
\'max\' => 100,
\'step\' => 1,
\'class\' => \'example-class\',
\'style\' => \'color: #ff0022\',
),
));
我正在使用以下内容尝试查看我的内容中的价值。。。。...
$content_mod = get_theme_mod(\'range_field_id1\');
return $content_mod;
...
但没有显示范围的运气。尽管如此,这个过程似乎对其他一切都有效。。。