I have issues with putting my own default custom-header image for my child theme, but am unable to do so without altering the parent theme (twenty seventeen).
I'm able to remove the custom header with:
remove_theme_support('custom-header', 15);
But when I add them back in my child theme, the child theme still shows the twenty seventeen default custom-header image
$custom_header_args = array(
'default-image' => get_theme_file_uri( '/assets/images/header.jpg' ),
'width' => 2000,
'height' => 1200,
'flex-height' => true,
'video' => true,
);
add_theme_support( 'custom-header', $custom_header_args );
This is maybe best demonstrated with the minor modifications in the twenty seventeen /inc/custom-header.php file.
add_theme_support( 'custom-header', apply_filters( 'twentyseventeen_custom_header_args', array(
'default-image' => get_parent_theme_file_uri( '/assets/images/header.jpg' ),
'width' => 2000,
'height' => 1200,
'flex-height' => true,
'video' => true,
'wp-head-callback' => 'twentyseventeen_header_style',
) ) );
remove_theme_support('custom-header');
add_theme_support( 'custom-header', apply_filters( 'twentyseventeen_custom_header_args', array(
'default-image' => get_theme_file_uri( '/assets/images/header.jpg' ),
'width' => 2000,
'height' => 1200,
'flex-height' => true,
'video' => true,
'wp-head-callback' => 'twentyseventeen_header_style',
) ) );
If I have it like this, the parent theme's header.jpg is shown as the custom header. However, if I comment out the first default-image definition, I see the child theme header.jpg.
So why are the previous values not overwritten? How are they even supposed to be overwritten?