Title: Adding Custom Header support error&#8230;. help me!
Last modified: August 20, 2016

---

# Adding Custom Header support error…. help me!

 *  [bfeely](https://wordpress.org/support/users/bfeely/)
 * (@bfeely)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/adding-custom-header-support-error-help-me/)
 * Hello,
 * I want to add Custom Header support to a theme I am creating. I have added the
   following snippet of code to **functions.php**.
 *     ```
       <?php
       if ( !function_exists('customisetheme_setup') ):
           function customisetheme_setup() {
               define( 'HEADER_IMAGE', '%s/header/default.jpg' );
   
               define( 'HEADER_IMAGE_WIDTH', apply_filters( 'customisetheme_header_image_width', 250 ) );
               define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'customisetheme_header_image_height', 125 ) );
   
               define( 'NO_HEADER_TEXT', true );
   
               add_custom_image_header( '', 'customisetheme_admin_header_style' );
   
               $customHeaders = array (
                       'amantea' => array (
                       'url' => '%s/header/default.jpg',
                       'thumbnail_url' => '%s/header/default.jpg',
                       'description' => __( 'Amantea', 'customisetheme' )
                   ),
                       'colosseum' => array (
                       'url' => '%s/header/colosseum.jpg',
                       'thumbnail_url' => '%s/header/colosseum.jpg',
                       'description' => __( 'Colosseum', 'customisetheme' )
                   )
               );
               register_default_headers($customHeaders);
           }
       endif;
   
       if ( ! function_exists( 'customisetheme_admin_header_style' ) ) :
           function customisetheme_admin_header_style() {
           ?>
               <style type="text/css">
                   #wpbody-content #headimg {
                       height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
                       width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
                       border: 1px solid #ccc;
                   }
               </style>
           <?php
           }
       endif;
   
       add_action( 'after_setup_theme', 'customisetheme_setup' );
       ?>
       ```
   
 * Okay. The Custom Header options page **does work**, however when publishing with
   the WordPress editor or publishing a post, the evil Headers already sent error
   pops up.
 * `Warning: Cannot modify header information - headers already sent by (output 
   started at /home2/goofball/public_html/dragg/wp-content/themes/ClicknDraggBlank/
   functions.php:8) in /home2/goofball/public_html/dragg/wp-includes/pluggable.php
   on line 934`
 * I have already read the FAQ Troubleshooting page in the Codex. (_Note_: I may
   be completely wrong about what I am about to say…) **My problem is that I intend
   to distribute the theme I am creating so telling others to edit their wp-config.
   php or pluggable.php is not gonna happen, if that is the problem.**
 * I don’t even know where to start. I am fairly confident the custom header code
   I put in functions.php is the troublemaker.
 * **Any help would be _very _greatly appreciated. Thanks!**
    If there is an area
   of this you would like me to expand on or explain better please tell me and I
   will try my best…

The topic ‘Adding Custom Header support error…. help me!’ is closed to new replies.

## Tags

 * [header](https://wordpress.org/support/topic-tag/header/)
 * [headers already sent](https://wordpress.org/support/topic-tag/headers-already-sent/)
 * [pluggable.php](https://wordpress.org/support/topic-tag/pluggable-php/)
 * [wp-config.php](https://wordpress.org/support/topic-tag/wp-config-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [bfeely](https://wordpress.org/support/users/bfeely/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/adding-custom-header-support-error-help-me/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
