0
快速的问题。WordPress的定制多个add_control的部分
我试图在WordPress自定义程序部分添加多个控件。
$wp_customize->add_section('lr_panel2', array(
'title' => esc_html__('Panel 2', 'lr'),
'active_callback' => 'is_front_page',
'panel' => 'lr_theme_options',
'description' => esc_html__('Add a background image to your panel by setting a featured image in the page editor. If you don’t select a page, this panel will not be displayed.', 'lr'),
));
$wp_customize->add_setting('lr_panel2', array(
'default' => false,
'sanitize_callback' => 'lr_sanitize_numeric_value',
));
$wp_customize->add_control('lr_panel2', array(
'label' => esc_html__('Panel Content', 'lr'),
'section' => 'lr_panel2',
'type' => 'dropdown-pages',
));
所以这一个工作正常和丹迪。我尝试添加第二个,但都不渲染。我以为我可以重复刚才的add_control类,类似:
$wp_customize->add_control('lodestar_panel2', array(
'label' => esc_html__('Panel Layout', 'lr'),
'section' => 'lr',
'type' => 'select',
'choices' => array(
),
));
,但是这不是工作,我想怎么也试过,有没有人这样做呢?
谢谢!