WordPress.org

Ready to get started?Download WordPress

Forums

Removed Default Headers, Still showing default image? (3 posts)

  1. jwack
    Member
    Posted 3 years ago #

    Note sure what is up here. I removed the default twentyten headers for my child theme. Then registered another set of images. However when I new blog is created using the child theme is still shows the default "Path" header image. In the admin it shows my custom images and the default ones removed as expected. Just not sure why on the users side it still showing the default header.

    // removes/unregisters the default headers in twentyten
    function my_default_remove_default_headers(){
        unregister_default_headers( array(
            'berries',
            'cherryblossom',
            'concave',
            'fern',
            'forestfloor',
            'inkwell',
            'path' ,
            'sunset')
        );
    }
    add_action( 'after_setup_theme', 'my_default_remove_default_headers', 11 );
    // Add/register additional header images
    function yourchildtheme_setup(){
        $yourchildtheme_dir =   get_bloginfo('stylesheet_directory');
        register_default_headers( array (
            'image1' => array (
                'url' => "$yourchildtheme_dir/images/header-dark.jpg",
                'thumbnail_url' => "$yourchildtheme_dir/images/header-dark-tn.jpg",
                'description' => __( 'Default Image', 'yourchildtheme' )
            ),
            'image2' => array (
                'url' => "$yourchildtheme_dir/images/header-light.jpg",
                'thumbnail_url' => "$yourchildtheme_dir/images/header-light-tn.jpg",
                'description' => __( 'Image Description', 'yourchildtheme' )
            )
        ));
    }
    add_action( 'after_setup_theme', 'yourchildtheme_setup' );

    Any Ideas?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Try looking in header.php.

  3. jwack
    Member
    Posted 3 years ago #

    In case anyway else is newb like me, I had to add the following into the child themes function.php...

    // set initial default header
    define( 'HEADER_IMAGE', '/wp-content/themes/theme-default/images/header-image.jpg' );

Topic Closed

This topic has been closed to new replies.

About this Topic