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 3 replies - 16 through 18 (of 18 total)

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

 *  [rosie4tune](https://wordpress.org/support/users/rosie4tune/)
 * (@rosie4tune)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/page/2/#post-2754487)
 * OK so now I realise what I am actually wanting to do is use the featured image,
   if it exists, as the header image. The COLLECTIONS page has a featured image 
   attached, which is cropped to the theme default 198…
 * But the code above is working to upload new header images at the new height. 
   Just need to figure out the feature image part of it now, as I would like certain
   pages to have their own particular header…
 *  [rosie4tune](https://wordpress.org/support/users/rosie4tune/)
 * (@rosie4tune)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/page/2/#post-2754488)
 * Rightio… so this is all I needed! Just as Chip said 🙂
 *     ```
       <?php
   
       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' );
       ```
   
 *  [fvalmol](https://wordpress.org/support/users/fvalmol/)
 * (@fvalmol)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/changing-header-code-in-functionsphp/page/2/#post-2754498)
 * Sorry.
 * I have seen all your comments but I dont know how it works.
 * I have copied the code that Chipsaid, and paste in funtions.php
 * Is it ok?
    Do I have anythingelse?
 * Thank you.

Viewing 3 replies - 16 through 18 (of 18 total)

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

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
