I removed/unregistered the theme (BirdTIPS) header images, but the default header image is still displayed. How to remove it programmatically (not css or editing header.php)?
My code:
add_action( 'after_setup_theme', 'remove_default_headers', 11 );
function remove_default_headers() {
remove_theme_support( 'custom-header', array(
'default-image',
) );
unregister_default_headers(
array(
'green',
'blue',
'yellow',
'red',
'white',
'orange',
'pink',
'purple'
)
);
}
In the header block of the header.php there is this code (I want to avoid to edit it, nor in the child theme):
<?php if ( ! empty( $birdtips_header_image ) ) : ?>
<?php if ( 'blank' == get_header_textcolor() ): ?>
<a href="<?php echo home_url( '/' ); ?>"><img src="<?php header_image(); ?>" alt="<?php bloginfo( 'name' ); ?>" ></a>
<?php else: ?>
<img src="<?php header_image(); ?>" alt="<?php bloginfo( 'name' ); ?>" >
<?php endif; ?>
<?php endif; ?>
<img src="<?php header_image(); ?>" alt="<?php bloginfo( 'name' ); ?>" >
. But if the image was removed by the above function, why it is loaded? Sorry for my ignorance, I am not a programmer.