Title: Changing header code in functions.php
Last modified: August 20, 2016

---

# Changing header code in functions.php

 *  [sbbn](https://wordpress.org/support/users/sbbn/)
 * (@sbbn)
 * [14 years ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/)
 * I’m having trouble changing the header image height in functions.php. I created
   a child theme functions.php file with nothing in it but this:
 * `define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'brunelleschi_header_image_height',
   300) );`
 * The original code says 198 for the height and I have changed it to 300. The Dashboard
   now says the image will be 300 px tall, but when I put in an image it gets scaled
   back down to the original 198 even though I changed the code.
 * Are there other lines of code I should be using?

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/page/2/?output_format=md)

 *  [Kakoma](https://wordpress.org/support/users/kakomap/)
 * (@kakomap)
 * [14 years ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754299)
 * Hi sbbn,
    The name of theme you are using and your site URL would help us give
   more informed responses BUT have you tried changing CSS instead?
 *  Thread Starter [sbbn](https://wordpress.org/support/users/sbbn/)
 * (@sbbn)
 * [14 years ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754312)
 * I forgot the URL, sorry:
 * marieprevostonline.com
 * I’m using Brunelleschi. I don’t think there’s anything in the style.css to define
   the header. Here is the code bit for the header in style.css:
 * _[CSS [code moderated](http://codex.wordpress.org/Forum_Welcome#Posting_Code)–
   a link to your site is enough to access the styles]_
 * Thanks!
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754345)
 * Hi, two things,
 * The child themes functions.php is run first before the parents functions.php,
   and you need to remove and reset the filter.
 * I hacked this together from one of my a twenty eleven child themes, it is **NOT
   Tested** so be careful.
 * [http://pastebin.com/R8QRS7Bu](http://pastebin.com/R8QRS7Bu)
 * If you change anything update and revise the pastebin for others that might read
   this topic.
 * There is an after setup theme function
 *     ```
       add_action( 'after_setup_theme', 'child_theme_setup' );
       ```
   
 * This should:
    Remove and reset the filter. Remove the existing header images 
   as they are not tall enough Set a new default header from the child themes /images/
   folder
 * HTH
 * David
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754360)
 * > but when I put in an image
 * did you upload a new image with the new dimensions?
 * afaik, the changes will only get applied to new uploaded images.
 *  Thread Starter [sbbn](https://wordpress.org/support/users/sbbn/)
 * (@sbbn)
 * [14 years ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754363)
 * Unfortunately that didn’t work, but thanks for trying! I fiddled with the code
   a bit and kept getting this error:
 * > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/XXXXXX/public_html/wp-content/themes/brunelleschi-child/functions.
   > php:1) in /home/XXXXXX/public_html/wp-includes/pluggable.php on line 866
 * (The X’s are just to block out my administration userid.)
 * That line 866 in pluggable.php is:
 * > header(“Location: $location”, true, $status);
 * I’m not really sure what that means.
 *  Thread Starter [sbbn](https://wordpress.org/support/users/sbbn/)
 * (@sbbn)
 * [14 years ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754364)
 * Hi alchymyth — Yes, I tried a new image, a custom one that I mocked up just so
   it would have a 300 px height. It was resized to the original 198 px height.
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754370)
 * Hi,
    I had the wrong arguments for removing the filter (singular), not filters(
   plural) like I had it in paste one.
 *     ```
       remove_filters( 'brunelleschi_header_image_height');
       ```
   
 * Should have been, in paste link two!
 *     ```
       remove_filter( 'brunelleschi_header_image_height', 198);
       ```
   
 * This is now **Tested Code**, I downloaded the theme and created a child theme,
   and it works fine!
 * [http://pastebin.com/3wVrD58p](http://pastebin.com/3wVrD58p)
 * HTH
 * David
 *  Thread Starter [sbbn](https://wordpress.org/support/users/sbbn/)
 * (@sbbn)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754446)
 * Thank you, but it didn’t work. I am flummoxed. I just cut and pasted it exactly
   as shown in the pastebin file into a new functions.php in the child theme folder.
 * I thought at first the problem was that I had changed the width from 1140 to 
   1024, but I went back to 1140 and that didn’t work, either.
 * I don’t think the problem is anything I did in the style.css file (in my child
   theme folder). All I changed in there were the colors, and I don’t think I accidentally
   broke some code while doing so.
 * Do you think an uninstall and re-install of Brunelleschi would help?
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754447)
 * Hi,
    Before you do that test the Brunelleschi Child Theme download from [this category link](http://digitalraindrops.net/all-downloads/?category=13),
   it is the files I used to test the concept.
 * HTH
 * David
 *  Thread Starter [sbbn](https://wordpress.org/support/users/sbbn/)
 * (@sbbn)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754451)
 * I downloaded those files, used them (deleting the ones I had in the directory
   previously) and it still didn’t work.
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754454)
 * You need to add your own filter:
 *     ```
       function brunelleschi_child_filter_header_image_height( $height ) {
           // set equal whatever height you want;
           // e.g. for 300px, use 300
           $new_height = 300;
           // now return it
           return $new_height;
       }
       add_filter( 'brunelleschi_header_image_height', 'brunelleschi_child_filter_header_image_height' );
       ```
   
 *  Thread Starter [sbbn](https://wordpress.org/support/users/sbbn/)
 * (@sbbn)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754455)
 * My goodness Chip, that did it. Thank you so much! And thank you too, Digital 
   Raindrops!
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754467)
 * Strange, I tested it again!
 * Default Headers Removed and New Header Size!
    [Screenshot Admin](http://digitalraindrops.net/images/brunelleschi-child1.png)
   [Screenshot Website](http://digitalraindrops.net/images/brunelleschi-child.png)
 * HTH
 * David
 *  Thread Starter [sbbn](https://wordpress.org/support/users/sbbn/)
 * (@sbbn)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754468)
 * That is so strange. I assume we both have WP 3.3.2, and we both surely downloaded
   the same version of Brunelleschi. I have no idea why it didn’t work for me.
 *  [rosie4tune](https://wordpress.org/support/users/rosie4tune/)
 * (@rosie4tune)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/#post-2754486)
 * Just wondering Chip if that little snippet is slotted into the functions.php 
   tested by Digital Raindrops, i.e.
 *     ```
       <?php
       /**
        * Tested code by Digital Raindrops modified by Rosie to register new 330 height including Chip's new function at end
       */
   
       add_action( 'after_setup_theme', 'child_theme_setup' );
   
       /** This function will hold any new calls and over-rides */
       if ( !function_exists( 'child_theme_setup' ) ):
       function child_theme_setup() {
   
       	/* Remove Filter and Apply a New Size */
       	remove_filter( 'brunelleschi_header_image_height', 198);
   
       function brunelleschi_child_filter_header_image_height( $height ) {
           // set equal whatever height you want;
           // e.g. for 300px, use 300
           $new_height = 330;
           // now return it
           return $new_height;
       }
       add_filter( 'brunelleschi_header_image_height', 'brunelleschi_child_filter_header_image_height' );}
       endif;
       ```
   
 * (that’s my entire functions.php in the child theme folder)
 * I can’t seem to get it working :-/
 * [http://www.travelswithmyhat.com/site](http://travelswithmyhat.com/site/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/page/2/?output_format=md)

The topic ‘Changing header code in functions.php’ is closed to new replies.

## Tags

 * [brunelleschi](https://wordpress.org/support/topic-tag/brunelleschi/)

 * 18 replies
 * 7 participants
 * Last reply from: [fvalmol](https://wordpress.org/support/users/fvalmol/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/page/2/#post-2754498)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
