• 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)
  • 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…

    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' );

    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)
  • The topic ‘Changing header code in functions.php’ is closed to new replies.