我已经成功地向主题定制器添加了一个部分,可以更改某个页面的标题图像。但是现在我想为另一个页面添加一个不同的部分,但第一部分总是被覆盖。。ID应该链接良好。
<?php
function af_customize_register($wp_customize){
// header image section
$wp_customize->add_setting(\'front_header_image\', array(
\'default\' => \'http://******.be/wp-content/uploads/2017/04/about-header-1200.jpg\',
\'transport\' => \'refresh\'
));
$wp_customize->add_section(\'front_header_image_section\', array(
\'title\' => \'Frontpage Header\',
\'description\' => \'Add an image to the front page.\',
\'priority\' => \'1\'
));
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
\'image\',
array(
\'label\' => \'Upload image to the frontpage\',
\'section\' => \'front_header_image_section\',
\'settings\' => \'front_header_image\'
)
)
);
// archive image section
$wp_customize->add_setting(\'archive_header_image\', array(
\'default\' => \'http://******.be/wp-content/uploads/2017/04/about-header-1200.jpg\',
\'transport\' => \'refresh\'
));
$wp_customize->add_section(\'archive_header_image_section\', array(
\'title\' => \'Archive Headers\',
\'description\' => \'Add an image to an archive page.\',
\'priority\' => \'10\'
));
//
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
\'image\',
array(
\'label\' => \'Upload image to archive page\',
\'section\' => \'archive_header_image_section\',
\'settings\' => \'archive_header_image\'
)
)
);
}
?>