我正在开发我的第一个WordPress主题,我想添加一个自定义菜单,最初是为了更改社交网络链接地址。。。我已将以下内容添加到functions.php:
/**
* Add Theme Customize Options
*/
function www_perlur_cloud_customize_register($wp_customize) {
/**
* Add Social Networks Links section to WordPress Theme Customize Menu
*/
$wp_customize->add_section( \'www_perlur_cloud_social_networks_links\',
array(
\'title\' => __(\'Social Networks Links\',\'www_perlur_cloud\'),
\'priority\' => 30,
\'capability\' => \'edit_theme_options\',
\'description\' => __(\'Allows you to customize Social Networks Links for PERLUR Group theme.\',\'www_perlur_cloud\')
)
);
}
/**
* Activate defined functions.
*
*/
add_action(\'init\', \'disable_emojis\');
add_action(\'customize_register\', \'www_perlur_cloud_customize_register\');
但是,当我在WordPress管理的主题部分单击Customize时,我没有看到“社交网络链接”部分。你知道这是怎么回事吗?我该怎么做才能修复它?
更新1:
我已将以下代码添加到www_perlur_cloud_customize_register 功能:
$wp_customize->add_control(\'social_icons_color\',
array(
\'type\' => \'color\',
\'priority\' => 10, // Within the section.
\'section\' => \'www_perlur_cloud_social_networks\', // Required, core or custom.
\'label\' => __(\'Date\'),
\'description\' => __(\'This is a date control with a red border.\'),
\'input_attrs\' => array(
\'class\' => \'my-custom-class-for-js\',
\'style\' => \'border: 1px solid #900\',
\'placeholder\' => __(\'mm/dd/yyyy\'),
),
\'active_callback\' => \'is_front_page\',
)
);
没有变化。。。我甚至尝试使用“附加CSS”,只添加了/***/并单击了发布。但没有变化…:-(
更新2:
问题可能是主题目录www.perlur.cloud 而不是www_perlur_cloud?