Wednesday, August 1, 2012

Custom Backgrounds

add_theme_support( 'custom-background' ); 

Note that you can add default arguments using:
$defaults = array( 'default-color' => '', 
'default-image' => '', 
'wp-head-callback' => '_custom_background_cb', 
'admin-head-callback' => '', 'admin-preview-callback' => '' ); 

add_theme_support( 'custom-background', $defaults ); 

Example  
An example using default '#000000' background color with 'background.jpg' background image:

$args = array( 'default-color' => '000000',
 'default-image' => get_template_directory_uri() . '/images/background.jpg', ); 
add_theme_support( 'custom-background', $args );

No comments:

Post a Comment