[theme-reviewers] Question on Custom Headers
otto at ottodestruct.com
Wed Sep 7 22:25:49 UTC 2011
On Wed, Sep 7, 2011 at 4:56 PM, Sayontan Sinha <sayontan at gmail.com> wrote:
> One of the comments on the last submission of my theme was that I should be
> using add_custom_image_header() if I am providing Custom Header
> functionality. So I started coding this into my theme. While doing so I
> noticed that the Header admin page has some text that is printed:
>> You can upload a custom header image to be shown at the top of your site
>> instead of the default one. On the next screen you will be able to crop the
>> Images of exactly 1000 × 55 pixels will be used as-is.
> The part that says 1000 x 55 comes from the defined values of
> HEADER_IMAGE_WIDTH and HEADER_IMAGE_HEIGHT. Now, while these functions can
> be filtered, they don't respond to fluid widths. Also, a sentence such as
> "Images of exactly 100% x 55 pixels will be used as-is" doesn't make sense.
> This makes it a problem for fluid width layouts. While I am not concerned
> about the actual generation of the CSS (since that is in my hands), the
> above text can get misleading. On a related note, if you filter the
> HEADER_IMAGE_WIDTH to make it pass a percentage, it trashes the "%".
> Is there a way to change / hide this text, then? As per the code in the core
> it is shown "if ( current_theme_supports( 'custom-header-uploads' ) )",
> which is obviously true, and I couldn't find any filter to turn this off.
> If anybody has other suggestions or if I have missed something please feel
> free to respond.
What exactly would a "fluid-width" header image look like?
See, images have sizes, in pixels. They aren't "fluid". They don't
scale up well. So if somebody uploads a 50x20 pixel header, are you
planning on scaling it across the whole screen? That might look like
My suggestion would be to define a maximum size for the image to be
(aka, pretty big), and then scale it down if you like. But images have
fixed sizes, and the custom header function has to take that into
account. The user needs to know the acceptable parameters of the
header image they're trying to create. The function needs to know
ratios for scaling.
In short, you *must* define a valid width, and height, in pixels. No
other option really makes any sense.
Now, if you are displaying it centered, or on the left-side, or even
on the right side, then that's fine. But if you're wanting it to
display at 100% width regardless of the actual size of the image, then
that's going to look pretty terrible on a lot of sites.
More information about the theme-reviewers