• 1.
    	// The custom header business starts here.
  • 2.
     
  • 3.
    	$custom_header_support = array(
  • 4.
    		// The default image to use.
  • 5.
    		// The %s is a placeholder for the theme template directory URI.
  • 6.
    		'default-image' => '%s/images/headers/path.jpg',
  • 7.
    		// The height and width of our custom header.
  • 8.
    		'width' => apply_filters( 'twentyten_header_image_width', 940 ),
  • 9.
    		'height' => apply_filters( 'twentyten_header_image_height', 198 ),
  • 10.
    		// Support flexible heights.
  • 11.
    		'flex-height' => true,
  • 12.
    		// Don't support text inside the header image.
  • 13.
    		'header-text' => false,
  • 14.
    		// Callback for styling the header preview in the admin.
  • 15.
    		'admin-head-callback' => 'twentyten_admin_header_style',
  • 16.
    	);
  • 17.
     
  • 18.
    	add_theme_support( 'custom-header', $custom_header_support );
  • 19.
     
  • 20.
    	if ( ! function_exists( 'get_custom_header' ) ) {
  • 21.
    		// This is all for compatibility with versions of WordPress prior to 3.4.
  • 22.
    		define( 'HEADER_TEXTCOLOR', '' );
  • 23.
    		define( 'NO_HEADER_TEXT', true );
  • 24.
    		define( 'HEADER_IMAGE', $custom_header_support['default-image'] );
  • 25.
    		define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
  • 26.
    		define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
  • 27.
    		add_custom_image_header( '', $custom_header_support['admin-head-callback'] );
  • 28.
    		add_custom_background();
  • 29.
    	}
  • 30.
     
  • 31.
    	// We'll be using post thumbnails for custom header images on posts and pages.
  • 32.
    	// We want them to be 940 pixels wide by 198 pixels tall.
  • 33.
    	// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
  • 34.
    	set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
  • 35.
     
  • 36.
    	// ... and thus ends the custom header business.
// The custom header business starts here. $custom_header_support = array( // The default image to use. // The %s is a placeholder for the theme template directory URI. 'default-image' => '%s/images/headers/path.jpg', // The height and width of our custom header. 'width' => apply_filters( 'twentyten_header_image_width', 940 ), 'height' => apply_filters( 'twentyten_header_image_height', 198 ), // Support flexible heights. 'flex-height' => true, // Don't support text inside the header image. 'header-text' => false, // Callback for styling the header preview in the admin. 'admin-head-callback' => 'twentyten_admin_header_style', ); add_theme_support( 'custom-header', $custom_header_support ); if ( ! function_exists( 'get_custom_header' ) ) { // This is all for compatibility with versions of WordPress prior to 3.4. define( 'HEADER_TEXTCOLOR', '' ); define( 'NO_HEADER_TEXT', true ); define( 'HEADER_IMAGE', $custom_header_support['default-image'] ); define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] ); define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] ); add_custom_image_header( '', $custom_header_support['admin-head-callback'] ); add_custom_background(); } // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 940 pixels wide by 198 pixels tall. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); // ... and thus ends the custom header business.

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter