• Resolved redhatgal

    (@redhatgal)


    I have a custom header image in jpg that is 780 x 138, but when I upload this header for this theme, it handles it as if it’s wider than 1000px, and therefore I have to crop it. Does anyone know what is going on? How do I force the theme to recognize it as 780 x 138?

    Amy

Viewing 8 replies - 1 through 8 (of 8 total)
  • Link? It’s very hard to understand what’s going on if we don’t have a link to your site.

    Cheers

    PAE

    Twenty Eleven uses a 940px header, so any image u upload will be uploaded to that size, even smaller images. So if u upload a smaller image it looks bad due to loss of pixels. To change the height and width of the twenty ten header you will have to edit functions.php and change HEADER_IMAGE_WIDTH and HEADER_IMAGE_HEIGHT to 780×138. But then u also need to change ur css (branding img) to the new size.

    Thread Starter redhatgal

    (@redhatgal)

    Hi Xam, thanks for your explanation. That makes sense. I’ll adjust the sizes in the functions.php. Gracias!

    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 customisations. Once your child theme is active, we should be able to help with the customisation.

    Thread Starter redhatgal

    (@redhatgal)

    Hi Esmi, yes, you’re right. I forgot to mention that I was using a child version of this theme, with an empty functions.php to fill in. : )

    In that case, try adding:

    add_filter( 'twentyeleven_header_image_width', 'my_header_width' );
    add_filter( 'twentyeleven_header_image_height', 'my_header_height' );
    function my_header_width($width) {
    	$width = 780;
    	return $width;
    }
    function my_header_height($height) {
    	$height = 138;
    	return $height;
    }
    Thread Starter redhatgal

    (@redhatgal)

    Thanks very much, esmi!

    mikeatkc

    (@mikeatkc)

    I was able to modify the image size in style.css file (fork theme). Adjust your height and width accordingly.

    #branding img {
    /* height: auto; */
    height: 188px;
    margin-bottom: -7px;
    width: 100%;
    }

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Twenty Eleven header image 1000px vs. 780px’ is closed to new replies.