#11855 closed enhancement (fixed)
Custom header template filter
Reported by: | dphiffer | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch reporter-feedback |
Focuses: | Cc: |
Description
I'm trying to use the built-in functionality that comes in custom-header.php, but found a couple things frustrating about the experience:
- Hard-coded markup, with no capacity for customization
- The final step in the process is pointless
I'm including a patch that addresses both these things:
- Allows a theme developer to specify a PHP script to be included in place of the default markup defined by custom-header.php
- Shows step1() instead of the "Visit your site and you should see the new header now." message
This is my first patch submission, so I'm sure I'm doing something wrong. Go easy on me :)
Attachments (1)
Change History (16)
#2
@
15 years ago
- Keywords has-patch added
I didn't even know about the Custom Image Header API until now.
I think dphiffer wants to be able to customize what is shown on the admin page, not on the front-end.
#3
@
15 years ago
Yes, scribu has it. There's an image upload & crop back-end component I'm trying to make more useful to my needs. I could put together a minimal demonstration theme if that's helpful for understanding my patch.
#4
@
15 years ago
- Keywords reporter-feedback added
- Milestone changed from Unassigned to Future Release
Screenshot would be nice. Give us more to go on.
#5
@
15 years ago
Sure, I'll attach before & after screenshots. The crux of the matter is the admin is imposing a precise markup pattern on the theme developer.
In my case my theme adds an adjustable overlay -- I'm using a jquery-ui drag thing that lets me easily upload a new header image and move the text band to an appropriate position. Because of that it's important that the markup be exactly the same on this page as it is for the front-end theme.
#6
@
15 years ago
Let's avoid doing an include on an arbitrary string. Since this is such a small block of markup, let's just pass the markup to the filter.
Getting rid of finished looks good, although the updated text could use a little more info.
More details on what you're wanting to do would indeed be helpful. That way we can think about what the best approach would be. For example would an action above the headimg div suffice? Or maybe a filter in header_image()? Also, maybe we'd like to steal whatever you're doing and bring it into core WP. :-)
#7
@
15 years ago
Oh hmm .. "Maximum attachment size: 262144 bytes"
#8
@
15 years ago
Thanks ryan, that's exactly the kind of feedback I was looking for! Let me rework things and put up a new patch.
Basically I think my beef is that, as a professional front-end developer, I want 100% control over what markup is on my website. All the way down to id="headerimg" vs id="header". Without *something* there, I'd probably rather go and just hard code this stuff instead of using the API.
#10
@
15 years ago
Yeah, I like that idea -- seems cleaner. Should I take a shot at that? I'd be curious to see the approach by somebody with more experience than me, but I also don't mind pitching in.
why add a custom-header.php template file, when you can just edit header.php to do what you want?