Enabling Additional CSS / custom-css

Custom CSS is a feature since 4.7

Just choose the Additional CSS tab when customizing your current theme to get started!

The problem is that a theme developed a while back does not show the Additional CSS tab.

I happened to be using twentythirteen as a base for another project, and there it is, nothing anywhere in the functions.php is enabling it, it just works.

Anyone have any idea about how to enable it?

While I can use the following:

$wp_customize->add_setting( 'custom_theme_css', array(
) );
$wp_customize->add_control( 'custom_theme_css', array(
  'label' => __( 'Custom Theme CSS' ),
  'type' => 'textarea',
  'section' => 'custom_css',
) );
    $wp_customize->add_section( 'custom_css', array(
  'title' => __( 'Custom CSS' ),
  'description' => __( 'Add custom CSS here' ),
  'panel' => '', // Not typically needed.
  'priority' => 160,
  'capability' => 'edit_theme_options',
  'theme_supports' => '', // Rarely needed.
) );

I am essentially creating a new setting, rather than using the new core feature.

I want to enable the core, something like $wp_customize->add_section('custom_css');

Read more here: Enabling Additional CSS / custom-css

Leave a Reply

Your email address will not be published. Required fields are marked *