WordPress.org

Forums

[Theme: Twenty Eleven} Delete custom header images (5 posts)

  1. markmichal
    Member
    Posted 3 years ago #

    I am using the theme Twenty Eleven. I have uploaded a number of images to use as my headers. I am now wanting to change those images to some updated ones. When I tried to do that, it seems that I can only add new ones, but the old ones stay there. So, when I use the "random" feature, it randomizes the new images as well as the old ones. Does anyone know how to delete the old ones so they are not included in my random header selection?

  2. Digital Raindrops
    Member
    Posted 3 years ago #

    This is the code I use in a twenty eleven child themes functions.php.

    add_action( 'after_setup_theme', 'childtheme_setup' );
    
    if ( ! function_exists( 'childtheme_setup' ) ):
    function childtheme_setup() {	
    
    	/* 1140 Remove Headers */
    	function dr_remove_twenty_eleven_headers(){
    		unregister_default_headers( array(
    			'wheel',
    			'shore',
    			'trolley',
    			'pine-cone',
    			'chessboard',
    			'lanterns',
    			'willow' ,
    			'hanoi')
    			);
    	}
    	add_action( 'after_setup_theme', 'dr_remove_twenty_eleven_headers', 11 );
    }
    endif;

    If this resolves the problem then please mark this topic as resolved!

    HTH

    David

  3. alchymyth
    Forum Moderator
    Posted 3 years ago #

    how to delete the old ones so they are not included in my random header selection?

    delete the images from
    dashboard - media - library

  4. Digital Raindrops
    Member
    Posted 3 years ago #

    Hi alchymyth,
    I an not sure but I thought the OP might mean the default headers when reffering to 'old ones', these load from the twenty eleven folder and not the media library, so cannot be deleted.

    So when the random images run do these include the default headers as well as the uploded ones, if so should really be an option to exclude default images.

    Either way they have two answers to work with.

    I could be wrong though, they might only mean their own uploaded images, which if removed from the header section should stop showing as random, or is the inclusion of removed header images an un-documented feature (bug):

    I am now wanting to change those images to some updated ones

    Regards

    David

  5. markmichal
    Member
    Posted 3 years ago #

    Alchymyth, you hit the nail on the head. That's exactly what I needed to do. Thank you. Digital Raindrops, thanks for your input too. There's no bug. I was using pictures that I had previously loaded. I also had the option of using the stock photos that came with the theme but I chose not to. Thanks guys!

Topic Closed

This topic has been closed to new replies.

About this Topic