在functions.php中使用这些代码,但是当我想要添加更多面板或部分时,它无法正常工作。 我看到太多的建议和相关的帖子但很失望。本教程的大部分内容与定制器中的颜色选项有关。
我无法确定问题究竟是什么。
function my_customize_register( $wp_customize ){
$wp_customize->add_panel('zakaraia_panel',array(
'title' => 'Custom Theme Option',
'priority' => '10',
'description' => ' this is a customize theme options panel'
));
$wp_customize->add_section( 'counter_section', array(
'title' => __( 'Counter', 'flexor' ),
'priority' => 5,
'description' => __( 'Description of section', 'flexor' ),
'panel' => 'zakaraia_panel',
) );
$wp_customize->add_setting( 'counter_default_number', array(
'default' => 'Counter Default number',
'transport' => 'refresh'
) );
$wp_customize->add_control( 'counter_default_number', array(
'section' => 'counter_section',
'label' => 'input counter number here',
'description' => 'this is a description of counter number here',
'type' => 'text'
) );
$wp_customize->add_setting( 'counter_default_text', array(
'default' => 'Counter Default Text',
'transport' => 'refresh'
) );
$wp_customize->add_control( 'counter_default_text', array(
'section' => 'counter_section',
'label' => 'input counter text here',
'description' => 'this is a text description input counter text here',
'type' => 'text'
) );
$wp_customize->add_setting( 'counter_default_link', array(
'default' => 'Counter Default Text',
'transport' => 'refresh'
) );
$wp_customize->add_control( 'counter_default_link', array(
'section' => 'counter_section',
'label' => 'input counter link paste here',
'description' => 'this is a link description',
'type' => 'text'
) );
}
add_action('customize_register','my_customize_register');