Techniques » Remove default WordPress Twenty Ten header images
How do you remove those pesky default header images included in the Twenty Ten WordPress theme. We recently used the Twenty Ten theme as a Parent Theme for a multi-site installation for a client. We wanted to retain the use of the custom header image, but didn’t want the default header images to be visible. It is accomplished with a few lines of code in the Twenty Ten child theme’s functions.php file. You are using a child theme, aren’t you?
First define a new function, we used remove_twenty_ten_headers(). We use the unregister_default_headers() WordPress function to un-register as many as we want. In our example we removed them all.
1 2 3 4 5 6 7 8 9 10 11 12 | function remove_twenty_ten_headers(){ unregister_default_headers( array( 'berries', 'cherryblossom', 'concave', 'fern', 'forestfloor', 'inkwell', 'path' , 'sunset') ); } |
We then initiate the new remove_twenty_ten_headers() function using the add_action() WordPress function as shown below. We make sure to call our function after the theme setup has run to be sure our function is called after register_default_headers() has already added the headers we want to remove.
1 | add_action( 'after_setup_theme', 'remove_twenty_ten_headers', 11 ); |
Putting it all together yields the following code to be placed in your theme’s functions.php file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /* Remove default twenty ten images ***********************************************/ function remove_twenty_ten_headers(){ unregister_default_headers( array( 'berries', 'cherryblossom', 'concave', 'fern', 'forestfloor', 'inkwell', 'path' , 'sunset') ); } add_action( 'after_setup_theme', 'remove_twenty_ten_headers', 11 ); |
How simple is that!


It is a miracle…It actually worked.
now if you can explain how to add images that are more proper to the site i’m working on it could be great
Thanks