I'm using the _s starter theme and setting up a custom header image. I've got this code:

add_theme_support( 'custom-header', apply_filters( 'xyztheme_custom_header_args', array(
    'default-image'          => get_template_directory_uri() . "/headerimg.jpg",
    'default-text-color'     => '000000',
    'width'                  => 1000,
    'height'                 => 250,
    'flex-height'            => true,
    'wp-head-callback'       => 'xyztheme_header_style',
) ) );

I'm using the header_image function to echo out the default header image (located in the root of the theme dir) into the header area. Upon selecting the default image in the customizer it does show up on the page and it did output the first couple of reloads when I was on the front end but after that it stopped displaying.

When I go into the customizer and select it again it shows up in the customizer view on the page but when I hit save and go back to the front end it doesn't show up anymore, going back to the customizer the header default image has been deselected somehow.

It does work if I choose to upload the image and use it from the media library.

Anyone else getting this bug?

  • Suggest you add your filter code for xyztheme_custom_header_args to the question in case the problem is there. – majick Mar 19 '16 at 2:07
  • Should there be a filter with a callback? This is what it _s provides out of the box. I cannot find any other places that references "xyztheme_custom_header_args" – Larry Lawless Mar 19 '16 at 17:55
  • ok it looks like an optional filter so thats probably not it anyway... get_header_image uses theme_mods to store the data, you might want to get_theme_mod('header_image'); and/or check the mod_{$themename); value via /wp-admin/options.php to see if it is saving... and when it is disappearing. – majick Mar 20 '16 at 6:56

Your Answer

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

Browse other questions tagged or ask your own question.