How to add default images for custom backgrounds?

if you are asking default background image for
add_theme_support( 'custom-background'); then it can be set using 'default-image' => get_template_directory_uri() . '/images/pattern.png',

complete code will look like below.

$args = array(
'default-color'  => 'f0f0f0',
'default-repeat' => 'fixed',
'default-image'  => get_template_directory_uri() . '/assets/images/pattern.png',
);
add_theme_support( 'custom-background', $args );

Leave a Comment