1

how to add three default images to wordpress custom background?

enter image description here

now, i want to add three default images which can be selected one by the user.and it locates on the upload Image part.like this:

the default background image:

enter image description here

how do i do thank you.

migrated from stackoverflow.com Jun 23 '11 at 10:29

This question came from our site for professional and enthusiast programmers.

1

You can see how the code is put to work in functions.php of TwentyEleven theme, line 135 - 195.

The codes to register your images are:

add_custom_image_header( 'twentyeleven_header_style', 'twentyeleven_admin_header_style', 'twentyeleven_admin_header_image' );
register_default_headers( array(
    'wheel' => array(
        'url' => '%s/images/headers/wheel.jpg',
        'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
        /* translators: header image description */
        'description' => __( 'Wheel', 'twentyeleven' )
    ),
    'shore' => array(
        'url' => '%s/images/headers/shore.jpg',
        'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg',
        /* translators: header image description */
        'description' => __( 'Shore', 'twentyeleven' )
    )
) );

Your Answer

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