我正在尝试为我正在创建的主题向wordpress主题定制器添加自定义字段。
$wp_customize->add_section(
\'sometheme_theme_customization_section\',
array(
\'title\' => __(\'Settings\', \'sometheme\'),
\'description\' => \'Custom settings for the sometheme theme\',
\'priority\' => 35,
)
);
$wp_customize->add_setting(
\'sometheme_headline\',
array(
\'default\' => \'\',
\'sanitize_callback\' => \'sometheme_sanitize_text\'
)
);
$wp_customize->add_control(
\'sometheme_headline\',
array(
\'label\' => __(\'Headline\', \'sometheme\'),
\'section\' => \'sometheme_theme_customization_section\',
\'type\' => \'text\',
)
);
$wp_customize->add_setting(
\'sometheme_tagline\',
array(
\'default\' => \'\',
\'sanitize_callback\' => \'sometheme_sanitize_text\'
)
);
$wp_customize->add_control(
\'sometheme_tagline\',
array(
\'label\' => __(\'Tagline\', \'sometheme\'),
\'section\' => \'sometheme_theme_customization_section\',
\'type\' => \'text\'
)
);
从上面的代码中可以看到,标题是在标语之前声明的。但出于某种原因,输出结果总是这样:
这是奇怪还是我错过了什么?提前感谢!