WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Reducing the req'd header height of 288 to something smaller (in TwentyEleven) (17 posts)

  1. Revived
    Member
    Posted 2 years ago #

    I like TwentyEleven overall but I need to reduce the height of the header to 160something. Where are these changes made?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. Create a child theme for your changes. Once your child theme is active, we should be able to help with the customisation.

  3. Patrick Nommensen
    Member
    Posted 2 years ago #

    I believe for this theme the changes are made in the functions.php

    define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyeleven_header_image_width', 1000 ) );
    	define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyeleven_header_image_height', 288 ) );
  4. Revived
    Member
    Posted 2 years ago #

    To clarify, I'm using a child theme sorry. So where would I reduce the height?

  5. esmi
    Forum Moderator
    Posted 2 years ago #

    Have a look at this article.

  6. Revived
    Member
    Posted 2 years ago #

    Beautiful. Thank you esmi! :)

  7. esmi
    Forum Moderator
    Posted 2 years ago #

    You're welcome :-)

  8. Revived
    Member
    Posted 2 years ago #

    I spoke too soon esmi. I'm getting the same errors that are mentioned in your comments.

    This is the child theme I'm using: http://futurewebblog.com/add-sidebar-support-posts-twenty-eleven-theme/

  9. esmi
    Forum Moderator
    Posted 2 years ago #

    What error do you get?

  10. Revived
    Member
    Posted 2 years ago #

    This is all I'm getting in the log:

    [15-Nov-2011 23:26:06] PHP Parse error: syntax error, unexpected T_STRING in /home/public_html/wp-content/themes/twentyelevenwithsidebar/functions.php on line 5

    Would you be willing to download that child theme above to try it?

  11. esmi
    Forum Moderator
    Posted 2 years ago #

    Drop a copy of that file into the WordPress pastebin and post the pastebin url here. Perhaps someone will be able to spot the problem and suggest a solution.

  12. Revived
    Member
    Posted 2 years ago #

    This is the child theme functions file.

    http://pastebin.com/kV6tkmBW

    Adding the following throws the error:

    function my_header_image_height($height) {
    return 150;
    }
    add filter( 'twentyeleven_header_image_height', 'my_header_image_height');

  13. esmi
    Forum Moderator
    Posted 2 years ago #

    We need to see the functions.php file with the new function in it and the error message that you then get.

  14. Revived
    Member
    Posted 2 years ago #

    http://pastebin.com/ctSEtKa5

    And the error:

    [15-Nov-2011 23:26:06] PHP Parse error: syntax error, unexpected T_STRING in /home/public_html/wp-content/themes/twentyelevenwithsidebar/functions.php on line 5

  15. esmi
    Forum Moderator
    Posted 2 years ago #

    You're missing an underscore in add filter. It should be:

    function my_header_image_height($height) {
    	return 150;
    }
    add_filter( 'twentyeleven_header_image_height', 'my_header_image_height');
  16. Revived
    Member
    Posted 2 years ago #

    Works now. :) My apologies and thank you immensely for your time and efforts!

  17. qenomesum
    Member
    Posted 2 years ago #

    thank you all. it worked for both twenty eleven header width and height.

    <?php
    
    add_filter( 'twentyeleven_header_image_width', 'sayiklamalar_header_image_width');
    function sayiklamalar_header_image_width($width) {
    	return 960;
    }
    
    add_filter( 'twentyeleven_header_image_height', 'sayiklamalar_header_image_height');
    function sayiklamalar_header_image_height($height) {
    	return 125;
    }
    
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.