[wp-hackers] dynamic custom header sizes

Alexander Höreth a.hoereth at gmail.com
Wed Sep 15 18:00:19 UTC 2010

Hey there,
I did not get much resonance at trac.wordpress.org so I will ask you guys..

A couple of days ago I started working on enhancing the custom image header
feature which came with 3.0.
I want to add the capability to use custom image headers without cropping
them to a fixed size.

For example, as a theme author, I would define HEADER_IMAGE_HEIGHT auto and
HEADER_IMAGE_WIDTH 940 in my functions.php. The enduser of my theme then
could decide on his own how high a header should be.
Or the theme author defines Header_IMAGE_WIDTH max:940 and positions it
margin: 0 auto.

Ok. Most of it works just fine already. The main problem which exercises me
atm is that I have to add 2 new functions to output the HEADER_IMAGE_WIDTH
and _HEIGHT without things like "auto" or "max:" ( header_image_width() &
header_image_size() ) and swap every usage of the old constants with the new
Where exactly would I have to add these? I did never before "hack" the
wordpress core, so I am just starting getting into it.

The only other things I need to change are the step_1() [output of the
expected header image sizes to the user], step_2() [processing of newly
uploaded header images] and js_2() [swap the HEADER_IMAGE_WIDTH and _HEIGHT
of the ImageAreaSelect script with the new header_image_ stuff] functions in

I hope I am not the only one interested in this feature,

More information about the wp-hackers mailing list