WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use the custom header feature for my theme and I’d like to add an additional upload field to the Custom Header page in the backend (page=custom-header) for a custom logo upload.

I found this but the custom options aren’t saved.

Thank you for any help!

share|improve this question

I just did something similar recently. Instead of putting it on the Custom Header page, you should be adding things to the Theme Customizer (new in 3.4). It's just as easy and is a more standard way of adding new theme options.

In fact, just by having added the Custom Header, the Theme Customizer should be active on your theme already. When you click Customize, you should see the header options in there. To add a new section that allows custom logo upload, try something like this:

add_action( 'customize_register', 'themename_customize_register' );
function themename_customize_register($wp_customize) {

    $wp_customize->add_section( 'ignite_custom_logo', array(
        'title'          => 'Logo',
        'description'    => 'Display a custom logo?',
        'priority'       => 25,
    ) );

    $wp_customize->add_setting( 'custom_logo', array(
        'default'        => '',
    ) );

    $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'custom_logo', array(
        'label'   => 'Custom logo',
        'section' => 'ignite_custom_logo',
        'settings'   => 'custom_logo',
    ) ) );

That code will give you a new box in the Theme Customizer, like so:

Theme Customizer logo upload

share|improve this answer
PS: Otto has a great write-up about using the Theme Customizer: ottopress.com/2012/… – clark Nov 3 '12 at 17:25
Thank you very much, already tested it! :) – user1706680 Nov 5 '12 at 21:13
Glad it worked! Mind picked it as the correct answer? (to help others find it) – clark Nov 7 '12 at 21:06
Thank you so much.. after I add this code I see the field to upload in customizer also I am ablo to upload the image. Anyhow how to print this anywhere we want it? echo get_header_image(); prints empty – Riffaz Starr May 12 '15 at 11:02
You need to wrap it in an img tag: <img src="<?php echo( get_header_image() ); ?>" alt="<?php echo( get_bloginfo( 'title' ) ); ?>" /> – clark May 13 '15 at 16:52

how you think get_header_image() will work? i can not see anything u write on function.php like get_header_image(); so how it should print the image?

SO please try it will work echo get_theme_mod( 'custom_logo' );

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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