Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/add custom background

This function has been deprecated since Version 3.4. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use add_theme_support instead.


Add callbacks for background image display.

The parameter $header_callback callback will be required to display the content for the 'wp_head' action. The parameter $admin_header_callback callback will be added to Custom_Background class and that will be added to the 'admin_menu' action.

Replace With

After deprecation this function was replaced with the following: add_theme_support( 'custom-background' )


<?php add_custom_background$header_callback$admin_header_callback$admin_image_div_callback ?>


(callback) (optional) Call on 'wp_head' action.
Default: ''
(callback) (optional) Call on custom background administration screen.
Default: ''
(callback) (optional) Output a custom background image div on the custom background administration screen. Optional.
Default: ''

Return Values

This function does not return a value.



  • Uses: Custom_Background Sets up for $admin_header_callback for administration panel display.

Change Log

Source File

add_custom_background() is located in wp-includes/deprecated.php.


Theme Support: add_theme_support(), remove_theme_support(), current_theme_supports()
Theme Features: sidebar, menus, post-formats, title-tag, custom-background, custom-header, post-thumbnails, automatic-feed-links, html5, editor-style, content_width

Further Reading - External Resources

See also index of Function Reference and index of Template Tags.