WordPress未注册主题定制分区

时间:2018-02-13 作者:Mark

我正在开发我的第一个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?

1 个回复
SO网友:obiPlabon

您将看不到该节,因为没有属于该节的控件。换句话说,这是一个空白部分。并且customizer不显示任何空白部分,您需要在该部分下至少有一个控件。这是正常的行为,所以不用担心。

结束

相关推荐

Responsive Admin Themes

我在看这个管理主题的示例(http://themepixels.com/main/themes/demo/webpage/shamcey/dashboard.html). 至于标签为“Navigation”的左侧管理栏,有没有一种方法可以在不使用插件的情况下实现这种类型的左侧仪表板管理菜单?我想用css、js或Jquery来实现这一点,任何处理编码的东西都可以。