Hi All, I want to enable the "Header" feature under "Appearance" in the WP control panel that will allow me to upload headers from my computer. I have the following code, but I don't know where exactly to add it or the path. I'm new to WP so I don't want to screw anything up in my Hostgator Account/folders/files. Any help, step by step tutorial, video or images will be GREATLY appreciated. Thanks so much! http://millionclues.com/problogging/wordpress-tips/make-your-theme-wordpress-3-0-compatible/ Custom Headers in WordPress 3.0 - Add this to your functions.php: define( 'HEADER_IMAGE', '%s/images/logo.png' ); // The default logo located in themes folder define( 'HEADER_IMAGE_WIDTH', apply_filters( '', 770 ) ); // Width of Logo define( 'HEADER_IMAGE_HEIGHT', apply_filters( '', 153 ) ); // Height of Logo define( 'NO_HEADER_TEXT', true ); add_custom_image_header( '', 'admin_header_style' ); // This Enables the Appearance > Header // Following Code is for Styling the Admin Side if ( ! function_exists( 'admin_header_style' ) ) : function admin_header_style() { ?> <style type="text/css"> #headimg { height: <?php echo HEADER_IMAGE_HEIGHT; ?>px; width: <?php echo HEADER_IMAGE_WIDTH; ?>px; } #headimg h1, #headimg #desc { display: none; } </style> <?php } endif; Use the Following hook in header.php to link to the header image: <?php header_image(); ?> Example - <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="Header Image" />
first take backup open the function.php file located in your theme directory and add the following code define( 'HEADER_IMAGE', '%s/images/logo.png' ); // The default logo located in themes folder define( 'HEADER_IMAGE_WIDTH', apply_filters( '', 770 ) ); // Width of Logo define( 'HEADER_IMAGE_HEIGHT', apply_filters( '', 153 ) ); // Height of Logo define( 'NO_HEADER_TEXT', true ); add_custom_image_header( '', 'admin_header_style' ); // This Enables the Appearance > Header // Following Code is for Styling the Admin Side if ( ! function_exists( 'admin_header_style' ) ) : function admin_header_style() { ?> <style type="text/css"> #headimg { height: <?php echo HEADER_IMAGE_HEIGHT; ?>px; width: <?php echo HEADER_IMAGE_WIDTH; ?>px; } #headimg h1, #headimg #desc { display: none; } </style> <?php } endif; Code (markup): open header.php located in your theme directory and add following code <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="Header Image" /> Code (markup):