【发布时间】:2014-07-10 16:28:16
【问题描述】:
我正在尝试在 Wordpress 定制器中添加一个额外的设置。您可以在网站标题和标语部分添加额外的设置,还是必须创建自己的部分?这是我的 functions.php 文件中的代码:
function mytheme_customize_register( $wp_customize )
{
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'your_setting_id',
array(
'label' => __( 'Your Label Name', 'theme_name' ),
'section' => 'title_tagline',
'settings' => 'your_setting_id',
'type' => 'text'
)
)
);
}
add_action( 'customize_register', 'mytheme_customize_register' );
如果我尝试转到管理区域中的自定义主题页面,但我收到以下错误:
Fatal error: Call to a member function check_capabilities() on a non-object in C:\xampp\htdocs\one-gas\wp-includes\class-wp-customize-control.php on line 161
【问题讨论】:
标签: wordpress