3
下面是我用來將該部分添加到自定義面板的代碼。訪問WordPress自定義面板值
function apple_customize_register($wp_customize){
$wp_customize->add_section('apple_footer', array(
'title' => 'Footer',
'priority' => 120,
));
//------ display copyright in footer
$wp_customize->add_setting('theme_options[copyright]', array(
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control('theme_options[copyright]', array(
'settings' => 'theme_options[copyright]',
'label' => __('Display Copyright'),
'section' => 'apple_footer',
'type' => 'checkbox',
'value' => '1'
));
}
add_action('customize_register', 'apple_customize_register');
我已經試過get_option('theme_options[copyright]')
,get_theme_mod('theme_options[copyright]')
更多的人,但所有var_dump
正在返回bool(false)
。
如何使用我的主題中的值?
非常感謝!這麼簡單,但這樣的表演塞。 –