Support » Themes and Templates » stop shrinking custom header images

  • Hey there,
    I want to have the uploaded custom header images to have a width of max 940px and a heigt of max 400px.
    If the uploaded image is smaller it should not be resized or cropped in the upload process – only if it is bigger than 940*400.

    Is there a way to do that?

    At the moment smaller images get scaled up and cropped to the size defined in the functions.php (HEADER_IMAGE_WIDTH and HEADER_IMAGE_HEIGHT)..

Viewing 6 replies - 1 through 6 (of 6 total)
  • You could put the image you want on a colored background which is the proper size so it doesn’t get resized on upload.

    not very comfortable fot the end user, is it? if it would be the theme im going to use i would do smth like that – but what about themes for others? i do not want to tell the client that he has to edit his headers manually

    Well you could add your own code to the theme for this function. Not every theme was made to be perfect for every user in every situation. I find twenty ten to be very flexible and easy to edit.

    I suppose the reasoning behind it is if the image were smaller it would require the theme to auto adjust to the size of the header being used. I’m no coder but I would guess that is a fairly extensive bit of code, the same thing goes for the reason why the header is cropped to a certain size.

    If you are using twenty ten, one way to get around this might be to try a theme called twenty ten weaver, which is alot like twenty ten but with more options. It has an option to choose what size you want the header to be, as well as many others. There is also 3 different flavors, one for beginners, one for advanced and one for theme creators.

    well i am not directly using twenty ten; i am using a wordpress integraded feature..

    maybe i start coding a plugin which changes this functionality – have no idea how to do this yet. completly new into plugins. but i think other designers would like this possibility as well.. maybe wordpress 3.1 will include it?
    anyone got an idea of how to start off to overrite a wordpress function without editing the core files and without an extra user interface?

    Ok.. well.
    I found the the main functions i would have to edit in the wp core – but is there a way to edit or overwrite them via a plugin?

    – step_2() located in line 564 in wp-admin/custom-header.php and handles the upload
    – step_3() located in line 649 and handles the cropping

    Ok. I justed hacked the core file. Where do I have to go to submit code to wordpress? I think it would be nice to have this in future WordPress Versions.

    Edit: just started a ticket at – nfm

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘stop shrinking custom header images’ is closed to new replies.