'443000', 'default-image' => get_template_directory_uri() . '/images/01_GROUSE_MTN_1024_350.jpg', 'default-repeat' => 'no-repeat', 'default-position-x' => 'center', 'wp-head-callback' => 'campmaine_background_style', ) ) ); } add_action( 'after_setup_theme', 'campmaine_custom_background_setup' ); if ( ! function_exists( 'campmaine_background_style' ) ) : /** * Modified from wp-includes/theme.php. * * background-position modification. * * Default custom background callback. * */ function campmaine_background_style() { // $background is the saved custom image, or the default image. $background = set_url_scheme( get_background_image() ); // $color is the saved custom color. // A default has to be specified in style.css. It will not be printed here. $color = get_background_color(); if ( $color === get_theme_support( 'custom-background', 'default-color' ) ) { $color = false; } // Don't show the background image if the admin wants to use image sliders. $image_slider_urls = get_option('image_slider_url_theme_options'); $has_slider_images = implode('', $image_slider_urls); if (!empty($has_slider_images)) return; if ( ! $background && ! $color ) return; $style = $color ? "background-color: #$color;" : ''; if ( $background ) { $image = " background-image: url('$background');"; $repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ); if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) $repeat = 'repeat'; $repeat = " background-repeat: $repeat;"; $position = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); // MAKE POSITION a percentage from TOP if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) $position = 'left'; $position = " background-position: $position 48px;"; $attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ); if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) ) { $attachment = 'scroll'; } $attachment = " background-attachment: $attachment;"; $style .= $image . $repeat . $position . $attachment; } ?>