I'm using add_theme_support( 'custom-header' ) to upload images for an image slider. The slider also has other settings in the customizer (duration, fade, overlay color, etc).

Because there are multiple settings all related to the slider, I'd like to group all of them in the same Customizer panel but I don't see a way to move custom-header into the same panel.

There are settings available but they don't seem to help in this particular case:

$defaults = array(
    'default-image'          => '',
    'width'                  => 0,
    'height'                 => 0,
    'flex-height'            => false,
    'flex-width'             => false,
    'uploads'                => true,
    'random-default'         => false,
    'header-text'            => true,
    'default-text-color'     => '',
    'wp-head-callback'       => '',
    'admin-head-callback'    => '',
    'admin-preview-callback' => '',
add_theme_support( 'custom-header', $defaults );


So the question is how to customize the location of custom-header in the customizer?


1 Answer 1


This is kind of a hacky way to accomplish this but digging around core reveals that the default section name is header_image:


So if we name the section we want it added to as header_image, the custom-header settings will automatically apply to that section. For example:

        'priority' => 10,
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => __( 'Example Panel', 'textdomain' ),
        'description' => __( 'Description of what this panel does.', 'textdomain' ),

        'title' => __( 'Slider Images', 'textdomain' ),
        'description' => __( 'This is a section for the slider images.', 'textdomain' ),
        'priority' => 10,
        'panel' => 'example_panel',

/* Header Image controls will load here */

The header images controls will display and you can you can continue to add other settings in the panel:

        'label' => __( 'Example Text', 'textdomain' ),
        'section' => 'header_image',
        'type' => 'text',
        'panel' => 'example_panel'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.