• I’ve seen this question a few times already in this forum, and I’m not sure if anyone’s posted a complete solution for it. But I found one, I guess it’s the cleanest one.

    You just need to go to your functions.php file, line 103 of the code, where you’ll find:

    // This theme allows users to set a custom background
    	add_custom_background();

    Select from there all the way down to line 209 (this line included), where you’ll find:

    <?php

    Erase all the thing out (from line 103 to 209). You’ll have your twenty ten’s child theme free of header and background functions in the frontend as in the backend (admin panel).

    If you want to keep background function running, just avoid erasing lines 103 and 104.

    Just in case you have some trouble finding line 209, it’s right after this:

    function fcwk_admin_header_style() {
    ?>
    <style type="text/css">
    /* Shows the same border as on front end */
    #headimg {
    	border-bottom: 1px solid #000;
    	border-top: 4px solid #000;
    }
    /* If NO_HEADER_TEXT is false, you would style the text with these selectors:
    	#headimg #name { }
    	#headimg #desc { }
    */
    </style>

    And as a bonus, if you’re like me, then you like keeping everything clean (at least when we’re talking about code :P). So you can also erase the function call located in your header.php file, from line 68 to 78:

    <?php
    	// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    	if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    			has_post_thumbnail( $post->ID ) &&
    			( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    		$image[1] >= HEADER_IMAGE_WIDTH ) :
    		// Houston, we have a new header image!
    		echo get_the_post_thumbnail( $post->ID );
    	elseif ( get_header_image() ) : ?>
    		<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    	<?php endif; ?>

    This may help you avoiding confusion when you get working on your header.php file.

    Hope it can be helpful and good luck! ;D

  • The topic ‘Remove all header and background functionality in Twenty Ten’ is closed to new replies.