我想你没有通过$wp_customize
正确地我会这样做:
创建设置e.x。section_number
它决定了用户的选择customizer.php
customizer.php
add_action(\'customize_register\', \'my_customizer\');
function my_customizer($wp_customize){
$section_number = get_theme_mod(\'section_number\', 0);
for($i = 0; $i <= $section_number; $i++) {
$wp_customize->add_section(
\'slider_\'.$i,
array(
\'title\' => __( \'Slider \'.$slider, \'Kraftzwerg\' ),
\'capability\' => \'edit_theme_options\',
\'panel\' => \'slider\'
)
);
}
应该有用。请注意,如果不附加任何设置,则不会显示分区