Opened 15 years ago
Closed 14 years ago
#12343 closed task (blessed) (fixed)
Custom Header Selector
Reported by: | ryan | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | UI | Keywords: | has-patch |
Focuses: | Cc: |
Description
Allow themes to register multiple pre-made headers from which to select. Also allow selecting a solid color header.
Attachments (5)
Change History (30)
#1
@
15 years ago
[13319] adds a selection of headers to twentyten. Thumnails for display in the admin UI are suffixed with -thumbnail. We can either have the theme specifically register headers or look for all images in a specific directory in the theme (twentyten uses headers/ but we can change that if needed).
#2
@
15 years ago
Maybe register_default_header_images('%s/headers/foo.png', '%s/headers/bar.png') where %s is replaced with the template directory as is done with HEADER_IMAGE. Thumbnails are assumed to be the same file names with a -thumbnail.$ext suffix.
#3
@
15 years ago
register_default_header_images( array('%s/headers/foo.png', '%s/headers/bar.png') )
#5
follow-up:
↓ 6
@
15 years ago
I've removed the old header from the theme's images directory, and moved the headers directory to %s/images/headers/.
#6
in reply to:
↑ 5
@
15 years ago
Replying to iammattthomas:
I've removed the old header from the theme's images directory, and moved the headers directory to %s/images/headers/.
In [13333].
#7
@
15 years ago
I haven't really looked into the custom header code yet, but I noticed that we can probably change/consolidate/remove some of this:
define( 'HEADER_TEXTCOLOR', ''); define( 'HEADER_IMAGE', '%s/images/header-1.jpg'); // %s is theme dir uri define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); define( 'NO_HEADER_TEXT', true );
In particular, my testbed is using HEADER_IMAGE by default, and that image no longer exists.
#8
@
15 years ago
I think the idea is that we'll use a solid color (no image) by default; although Matt mentioned the possibility of choosing an image based on blog URL or something like that. Depends on if someone wants to make it happen. :)
#15
@
15 years ago
- Keywords has-patch added
This patch gets us part of the way there on style; once the color selector is in place I'll take another look.
#18
@
15 years ago
- Cc justin.shreve@… added
As far as I could tell there was nothing for picking background colors yet - just text color.
This patch adds support for a custom background color instead of an image and works the way the original comp described. It also adds some new functions and a default custom header callback to output the new header BG without using the style="" attribute.
comments?
#20
@
15 years ago
- Cc aaron@… added
register_default_headers doesn't properly use %s in child themes. Since %s is substituted for get_template_directory_uri in register_defualt_headers and get_template_directory_uri returns the parent theme uri, child themes can't use %s for it's uri. Ideally we instead have %s substitute the uri for the folder that calls register_defualt_headers or have a paramater for register_default_headers that allows the child themes uri so that both parent and child themes can register default headers.
@
15 years ago
Allow child themes / plugins to add to the list of default headers and preserve the existing default headers
#21
@
15 years ago
Currently the default headers are overridden the second time register_default_headers is called. Since child themes might want to keep the list of default headers available, the we should call array_merge the subsequent times it is called. the above patch allows that.
Comp