Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My Google-Fu is letting me down so I'm trying it here.

I'm building a theme and I want the customer to be able to change the header image him/herself in the wp-admin. How do I go about this?

As I said my Google-Fu has been embarrasingly lacking on this one so even a link to where to start would be fantastic.

Thanks!

share|improve this question

closed as off-topic by Chip Bennett, t f, toscho Jan 6 at 18:02

  • This question does not appear to be about WordPress within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Interestingly, there is a Codex page named "Custom Headers". –  s_ha_dum Sep 12 '13 at 4:24
    
Exactly what I was looking for. Thank you, I am an idiot. –  Timsalabim Sep 12 '13 at 21:45
2  
This question appears to be off-topic because it is answered with nothing more than a Codex link –  Chip Bennett Jan 6 at 16:37

1 Answer 1

up vote 0 down vote accepted
  1. You can add theme support in your functions file for a Custom Header page using this code which also enables you to add a default size and selector class which you can style with CSS.

     add_theme_support( 'custom-header', array( 
    'width'           => 320,
    'height'          => 60,
    'header-selector' => '.site-title a',
    'header-text'     => false
      ) );     
    
  2. Or this method enables the user to change the header image in every page.

You can add this feature using custom fields with a header hook which isn't difficult.

The hardest part would be coding the meta box to display on all edit screens however the Codex offers a very basic example.

Another solution would be to use the code from the Twenty Eleven default theme which enables the use of Featured Images as header images on every single post or page. Slick featured for a theme in my opinion as it already includes the meta box.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.