Add custom background color to WordPress theme

Used before category names. WordPress WordPress Development

open “functions.php” file and write the below code in it.

if (!function_exists('hs_setup')) :
    function hs_setup()
    {
        add_theme_support(
            'custom-background',
            apply_filters(
                'hs_custom_background_args',
                array(
                    'default-color' => 'ffffff',
                    'default-image' => '',
                )
            )
        );
    }
    add_action('after_setup_theme', 'hs_setup');
endif;
Tags: