get_background_color example

if ( is_user_logged_in() ) {
        $classes[] = 'logged-in';
    }

    if ( is_admin_bar_showing() ) {
        $classes[] = 'admin-bar';
        $classes[] = 'no-customize-support';
    }

    if ( current_theme_supports( 'custom-background' )
        && ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() ) ) {
        $classes[] = 'custom-background';
    }

    if ( has_custom_logo() ) {
        $classes[] = 'wp-custom-logo';
    }

    if ( current_theme_supports( 'responsive-embeds' ) ) {
        $classes[] = 'wp-embed-responsive';
    }

    

function get_background_color() {
    return get_theme_mod( 'background_color', get_theme_support( 'custom-background', 'default-color' ) );
}

/** * Displays background color value. * * @since 3.0.0 */
function background_color() {
    echo get_background_color();
}

/** * Default custom background callback. * * @since 3.0.0 */
function _custom_background_cb() {
    // $background is the saved custom image, or the default image.     $background = set_url_scheme( get_background_image() );

    
<?php _e( 'Preview' ); ?></th> <td> <?php         if ( $this->admin_image_div_callback ) {
            call_user_func( $this->admin_image_div_callback );
        } else {
            $background_styles = '';
            $bgcolor           = get_background_color();
            if ( $bgcolor ) {
                $background_styles .= 'background-color: #' . $bgcolor . ';';
            }

            $background_image_thumb = get_background_image();
            if ( $background_image_thumb ) {
                $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) );
                $background_position_x  = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
                $background_position_y  = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) );
                $background_size        = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) );
                $background_repeat      = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );
                
Home | Imprint | This part of the site doesn't use cookies.