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!

2 Answers 2


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

  • PS: Otto has a great write-up about using the Theme Customizer: ottopress.com/2012/…
    – clark
    Nov 3, 2012 at 17:25
  • Glad it worked! Mind picked it as the correct answer? (to help others find it)
    – clark
    Nov 7, 2012 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 May 12, 2015 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, 2015 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' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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