我删除/注销了主题(BirdTIPS)标题图像,但仍显示默认标题图像。如何以编程方式删除它(而不是css或编辑header.php)?
我的代码:
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\'
)
);
}
在标题的标题块中。php有以下代码(我希望避免编辑它,也不要在子主题中): <?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; ?>