• Resolved samski_1

    (@samski_1)


    This is my first time using wordpress and I am having difficulty enlarging the height of my header to fit my custom image in the modularity lite theme. I have changed the image height parameters in the header php. section in the editing area but it still wants me to crop my image once I upload it.

    I have had a look in the two css sheets but can not find a reference to the header height at all.

    Any help would be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The header is controlled in functions.php not in header.php or style.css

    It is recommended to create child theme so that if you update your theme you do not loose the change.

    Information how to create child theme is here
    https://codex.www.ads-software.com/Child_Themes

    If You decide to create theme then add this filter in child theme just after <?php functions.php or you can put in theme functions.php if you want but remember you will loose the change if you update.

    add_filter('HEADER_IMAGE_HEIGHT','my_header_height');
    add_filter('HEADER_IMAGE_WIDTH','my_header_width');
    function my_header_height($size){
       return 110;
    }
    function my_header_width($size){
       return 350;
    }

    Change the width and height to exact size of your image.

    Thread Starter samski_1

    (@samski_1)

    Thanks a lot govpatel. Problem fixed!

    You are welcome.

    Dearest Govpatel,

    I just came across this post and it is quite similar to my problem so perhaps you would be able to help?

    I’m new to WordPress, I have been building websites using divs, 960 grids etc before so I am quite familiar to (basic) coding but… here in WordPress it seems to be very different and extremely complicated so I feel lost to say the least.

    I have created a child theme (of the delicate theme) following the step by step instructions provided by WordPress. I am now struggling to make any changes. First of all I would like to remove the ‘search’ function on the top right corner but I can’t for my life figure out where in the code this is. Also even if I manage to find it – it will be in the parent directory (delicate theme) and surely I’m not allowed to remove it from there…

    How do you remove things (like this function) from the child theme?

    I would also like to make the header image bigger. At the moment it is set to width 970 and height 225 px but I want to change it to height 430 px.

    I tried your solution above and created a function.php file that I uploaded to my child theme directory. This is what I wrote in the file

    <?php
    add_filter(‘HEADER_IMAGE_HEIGHT’,’430′);
    add_filter(‘HEADER_IMAGE_WIDTH’,’970′);
    function my_header_height($size){
    return 110;
    }
    function my_header_width($size){
    return 350;
    }

    ?>

    This is what’s written in my Style Sheet

    /*
    Theme Name: Delicate Child
    Description: Child theme for the delicate theme
    Author: Michelle Hedberg
    Template: delicate
    */

    @import url(“../delicate/style.css”);

    #site-title a {
    color: #009900;
    }

    Unfortunately it still doesn’t work. When I click on the upload image button (under the theme/header links under the dashboard) it still crops my image to 225 px.

    I would be immensely grateful if you could shed some light on this problem

    Warm Regards

    Michelle

    Hi again Govpatel,

    This is a link to my (test) site so you can see what I mean. I wish to modify this theme according to my design

    https://test.michellehedberg.net/

    I tried your solution above and created a function.php file that I uploaded to my child theme directory. This is what I wrote in the file

    <?php
    add_filter(‘HEADER_IMAGE_HEIGHT’,’430′);
    add_filter(‘HEADER_IMAGE_WIDTH’,’970′);
    function my_header_height($size){
    return 110;
    }
    function my_header_width($size){
    return 350;
    }

    ?>

    I do not know how you theme is designed for header as this filter works on default theme.

    Without looking at theme is hard to know how the theme is designed.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Help needed to enlarge modularity lite header’ is closed to new replies.