【发布时间】:2015-11-21 03:41:13
【问题描述】:
在我的主题自定义菜单中,我希望有一个页脚选项部分。这是列数以及每列的标题标题。到目前为止,我所拥有的是图像,所有选项都保存为相同的东西。如何更改它,使每个部分都有不同的值?
我在functions.php中的代码:
/*
Footer headers and number of columns
*/
$wp_customize->add_setting( 'footer_options', array(
'title' => __( 'Footer column options', 'Universal Theme'),
'capability' => 'edit_theme_options',
'description' => __( 'Update footer options')
));
$wp_customize->add_section( 'footer_options', array(
'title' => __( 'Footer options', 'Universal Theme' ),
'capability' => 'edit_theme_options'
));
$wp_customize->add_control( 'footer_options', array(
'settings' => 'footer_options',
'section' => 'footer_options',
'type' => 'radio',
'choices' => array(
1 => __( '1' ),
2 => __( '2' ),
3 => __( '3' ),
4 => __( '4' ),
5 => __( '5' ),
6 => __( '6' )
),
'label' => __( 'Number of columns' )
));
$wp_customize->add_control( 'footer_options_header1', array(
'settings' => 'footer_options',
'section' => 'footer_options',
'type' => 'text',
'label' => __( 'Footer header 1' )
));
$wp_customize->add_control( 'footer_options_header2', array(
'settings' => 'footer_options',
'section' => 'footer_options',
'type' => 'text',
'label' => __( 'Footer header 2' )
));
$wp_customize->add_control( 'footer_options_header3', array(
'settings' => 'footer_options',
'section' => 'footer_options',
'type' => 'text',
'label' => __( 'Footer header 3' )
));
$wp_customize->add_control( 'footer_options_header4', array(
'settings' => 'footer_options',
'section' => 'footer_options',
'type' => 'text',
'label' => __( 'Footer header 4' )
));
$wp_customize->add_control( 'footer_options_header5', array(
'settings' => 'footer_options',
'section' => 'footer_options',
'type' => 'text',
'label' => __( 'Footer header 5' )
));
$wp_customize->add_control( 'footer_options_header6', array(
'settings' => 'footer_options',
'section' => 'footer_options',
'type' => 'text',
'label' => __( 'Footer header 6' )
));
所有这些都在一个放在'customize_register'的add_action中的函数中
我需要进行哪些更改才能使其正常工作?
【问题讨论】: