• Guido

    (@guido07111975)


    Hi,

    My themes supports the custom header feature and I have set a default header:

    $args = array(
    	'width' => 600,
    	'height' => 400,
    	'default-image' => get_template_directory_uri() . '/images/header.jpg',
    	'header-text' => false,
    	'uploads' => true,
    	);
    	add_theme_support( 'custom-header', $args );

    When I have set another header and want to turn back to the default one I simply press the ‘Suggested’ one in Theme Customizer… and press save.

    BUT, when I reload the page the previous header is displayed again.
    It only works when I completely remove the previous one. This is not how it should be.

    Bug in Theme Customizer?

    Guido

    ps. I previously removed another function from my theme, called register_default_headers because I thought the other function is enough… but maybe it’s not?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi there!

    What theme are you using and where did you get it from? Have you tried any other theme that supports custom-headers to rule out a theme issue?

    Thread Starter Guido

    (@guido07111975)

    Hi Jose,

    My own theme(s).
    Only works with a combination like this:

    // Custom header
    	$args = array(
    	'width' => 1700,
    	'height' => 400,
    	'default-image' => get_template_directory_uri() . '/images/boats.jpg',
    	'header-text' => false,
    	'uploads' => true,
    	);
    add_theme_support( 'custom-header', $args );
    
    // Default header
    register_default_headers( array(
    	'boats' => array(
    		'url'           => get_template_directory_uri() . '/images/boats.jpg',
    		'thumbnail_url' => get_template_directory_uri() . '/images/boats.jpg',
    		'description'   => __( 'Default header', 'textdomain' )
    	)
    ) );

    Did a quick test with Twenty Eleven.
    In file functions I removed ‘register_default_headers’ and added the default-image string in array ‘$custom_header_support’.
    The result is the same.

    Guido

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hey Guido,

    That is a little odd but part of me wants to say that it could be expected behavior. A strange one I know. O_o

    I’ll try and search the core code as to why it could be doing that. I have a feeling it will be in the theme.php file.

    Thread Starter Guido

    (@guido07111975)

    Great.

    Please let me know your outcome. I don’t have enough php knowledge of this.

    But if a user should always register a default header image when using ‘default-image’ this should be mentioned in codex.

    Guido

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom header image issue – default header not displayed’ is closed to new replies.