Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
You should take a look at http://codex.wordpress.org/Function_Reference/register_default_headers - this is the function you need to setup your own images when using custom headers. –  user8394 Sep 3 '11 at 14:43
add comment

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

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

1 Answer

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' )
    )
) );
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.