Title: add_theme_support( &#039;custom-header&#039; );
Last modified: August 31, 2016

---

# add_theme_support( 'custom-header' );

 *  [Tieran](https://wordpress.org/support/users/tieran/)
 * (@tieran)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/)
 * My dashboard has disappeared after placing the following code into my functions.
   php file in Editor;
 * add_theme_support( ‘custom-header’ );
    $defaults = array( ‘default-image’ => ”,‘
   width’ => 0, ‘height’ => 0, ‘flex-height’ => false, ‘flex-width’ => false, ‘uploads’
   => true, ‘random-default’ => false, ‘header-text’ => true, ‘default-text-color’
   => ”, ‘wp-head-callback’ => ”, ‘admin-head-callback’ => ”, ‘admin-preview-callback’
   => ”, ); add_theme_support( ‘custom-header’, $defaults );
 * Now when I try to login to dashboard I only see a white page with the above code
   at the top of the page.
 * **What must I do to correct things .. please note I am using a localhost MAMP
   Pro**
 * Thanks in advance

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/#post-7012315)
 * Can you post the entirety of your theme’s `functions.php` to [Pastebin](http://pastebin.com/)
   and post the link here? Other than the lack of the PHP opening tag, none of your
   code looks particularly problematic.
 *  [Hardeep Asrani](https://wordpress.org/support/users/hardeepasrani/)
 * (@hardeepasrani)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/#post-7012316)
 * Hi Tieran,
 * You should post your code wrapped inside a function like this:
 *     ```
       function themename_custom_header_setup() {
           $args = array(
              'default-image' => '',
              'width' => 0,
              'height' => 0,
              'flex-height' => false,
              'flex-width' => false,
              'uploads' => true,
              'random-default' => false,
              'header-text' => true,
              'default-text-color' => '',
              'wp-head-callback' => '',
              'admin-head-callback' => '',
              'admin-preview-callback' => '',
          );
           add_theme_support( 'custom-header', $args );
       }
       add_action( 'after_setup_theme', 'themename_custom_header_setup' );
       ```
   
 * Let me know if this works. 🙂
 * Regards,
    Hardeep
 *  Thread Starter [Tieran](https://wordpress.org/support/users/tieran/)
 * (@tieran)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/#post-7012336)
 * HI Stephen & Hardeep
 * Thank you for your replies
 * @ Stephen I can’t seem to find the functions.php file .. after searching for 
   it I found about 10 such files and opened each of them with text editor but none
   of them seem to be the file that I added code to.
 * I added the code from the Dashboard Editor .. would I still expect to find the
   file on my computer if using a localhost ? If so do you have any suggestions 
   as to where I might find the file ?
 * Thanks in advance
 * Tieran
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/#post-7012341)
 * What theme are you using? The file you edited is (likely) located at `wordpress/
   wp-content/themes/your-theme-folder/functions.php`, but the full location would
   depend on how you installed MAMP.
 * You could copy the text directly from the built-in editor, though, and then paste
   it to [Pastebin](http://pastebin.com/).
 *  Thread Starter [Tieran](https://wordpress.org/support/users/tieran/)
 * (@tieran)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/#post-7012345)
 * Im using Health Medical theme
 * [http://themeforest.net/item/health-medical-wordpress-theme-for-medicine/9452706?WT.oss_phrase=&WT.oss_rank=9&WT.z_author=madza&WT.ac=search_list](http://themeforest.net/item/health-medical-wordpress-theme-for-medicine/9452706?WT.oss_phrase=&WT.oss_rank=9&WT.z_author=madza&WT.ac=search_list)
 * The function.php at that location (pastbin link below) does not appear to contain
   the code that I added
 * [http://pastebin.com/csPEUHXR](http://pastebin.com/csPEUHXR)
 *  Thread Starter [Tieran](https://wordpress.org/support/users/tieran/)
 * (@tieran)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/#post-7012351)
 * unfortunately I can’t copy the text directly from the built-in editor, as the
   dashboard is inaccessible >> each time I try to log into dashboard I get a white
   page with the following text at the top;
 * add_theme_support( ‘custom-header’ ); $defaults = array( ‘default-image’ => ”,‘
   random-default’ => false, ‘width’ => 0, ‘height’ => 0, ‘flex-height’ => false,‘
   flex-width’ => false, ‘default-text-color’ => ”, ‘header-text’ => true, ‘uploads’
   => true, ‘wp-head-callback’ => ”, ‘admin-head-callback’ => ”, ‘admin-preview-
   callback’ => ”, ); add_theme_support( ‘custom-header’, $defaults );
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/#post-7012404)
 * Do you remember exactly which file you originally edited? Alternatively, if you
   know where you have WordPress installed on your computer, you could try [redownloading WordPress](https://wordpress.org/download/)
   and then replacing all of the files in your WP installation **except for** `wp-
   config.php` and your `wp-content/` folder. As long as you don’t disturb the `
   wp-content/` folder, you won’t lose any of your downloaded themes, anything that
   you’ve uploaded to your media library, or any posts you’ve made.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘add_theme_support( 'custom-header' );’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/add_theme_support-custom-header/#post-7012404)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
