出于某种原因我active_callback => \'is_front_page\'
不工作,因此没有显示在首页的自定义程序中。我已经将我的首页设置为静态,并在阅读设置中选择了主页。我不知道怎么了。
感谢您的帮助:)
Code:
functions.php
// Customizer
function themeE4K_customize_register( $wp_customize ) {
// Add Settings
$wp_customize->add_setting(\'slider_one\', array(
\'default-image\' => get_template_directory_uri() . \'/assest/imgs/featureProducts/product1.png\',
\'transport\' => \'refresh\',
));
$wp_customize->add_setting(\'slider_two\', array(
\'default-image\' => get_template_directory_uri() . \'/assest/imgs/featureProducts/product1.png\',
\'transport\' => \'refresh\',
));
// Add Section
$wp_customize->add_section(\'slider_image\', array(
\'title\' => __(\'Slider Images\', \'e4k-theme\'),
\'description\' => __(\'Slider Images for the Home Page of the E4K Theme\'),
\'priority\' => 10,
\'active_callback\' => \'is_front_page\',
));
// Add Controls
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, \'slider_one_control\', array(
\'label\' => __(\'Slider Image #1\', \'e4k-theme\'),
\'section\' => \'slider_image\',
\'settings\' => \'slider_one\',
)));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, \'slider_two_control\', array(
\'label\' => __(\'Slider Image #2\', \'e4k-theme\'),
\'section\' => \'slider_image\',
\'settings\' => \'slider_two\',
)));
}
add_action(\'customize_register\', \'themeE4K_customize_register\');