无法在WordPress定制器中添加更多面板和部分。我需要2个面板和3个部分。但不明白为什么我的鳕鱼不起作用

时间:2017-10-01 06:54:25

标签: php wordpress

在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');

0 个答案:

没有答案