WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Preventing header resizing in twenty-eleven theme (3 posts)

  1. MC
    Member
    Posted 1 year ago #

    I am building a child theme for twenty-eleven. I came across this closed thread referring to commenting out 2 lines in the functions.php in the parent theme folder.
    http://wordpress.org/support/topic/how-to-prevent-resizing-of-custom-header-image-twenty-ten?replies=6

    Is there a way to override this. It seems he refers to a way but there isn't really any conclusion in that thread it seems whether or not that works. Here is the part of the thread I am interested in looking into a bit more. Ideally, of course, I would prefer to make the modifications in the child themes functions.php file, not the parent.

    The following lines are quoted from that thread.

    There is also a function remove_theme_support(), not sure if it works in reverse, try adding nested inside you child themes after_setup_theme function.

    /* Remove theme support for Post Thumbnails */
    function remove_custom_theme_support(){
    	remove_theme_support('post-thumbnails');
    }
    add_action( 'after_setup_theme', 'remove_custom_theme_support', 11 );
  2. MC
    Member
    Posted 1 year ago #

    For now I am going to hard code it into the header.php in my child theme in order to sidestep this using conditional tags, but I would really like to figure out how to do this in the child theme. The code I posted was referencing the 2010 theme. I am using 2011, but its a development site so I guess its a good place to test it out and see what happens :)

  3. MC
    Member
    Posted 1 year ago #

    I figured it out so I wanted to contribute the solution in case anyone is looking for the answer here.

    I put these lines in the child themes functions and modded the sizes

    // override header image resizing function in theme
    define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyeleven_header_image_width', 1000 ) );
    define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyeleven_header_image_height', 500 ) );

    Hope this helps :)

Topic Closed

This topic has been closed to new replies.

About this Topic