Changeset 3589
- Timestamp:
- 12/27/2010 06:01:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-themes/bp-default/functions.php
r3588 r3589 60 60 61 61 // This theme allows users to set a custom background 62 add_custom_background( );62 add_custom_background( 'bp_dtheme_custom_background_style' ); 63 63 64 64 // Changeable header section starts here … … 197 197 endif; 198 198 199 if ( !function_exists( 'bp_dtheme_custom_background_style' ) ) : 200 /** 201 * The style for the custom background image or colour. 202 * 203 * Referenced via add_custom_background() in bp_dtheme_setup(). 204 * 205 * @see _custom_background_cb() 206 * @since 1.3 207 */ 208 function bp_dtheme_custom_background_style() { 209 $background = get_background_image(); 210 $color = get_background_color(); 211 if ( ! $background && ! $color ) 212 return; 213 214 $style = $color ? "background-color: #$color;" : ''; 215 216 if ( $style && !$background ) { 217 $style .= ' background-image: none;'; 218 219 } elseif ( $background ) { 220 $image = " background-image: url('$background');"; 221 222 $repeat = get_theme_mod( 'background_repeat', 'repeat' ); 223 if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) 224 $repeat = 'repeat'; 225 $repeat = " background-repeat: $repeat;"; 226 227 $position = get_theme_mod( 'background_position_x', 'left' ); 228 if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) 229 $position = 'left'; 230 $position = " background-position: top $position;"; 231 232 $attachment = get_theme_mod( 'background_attachment', 'scroll' ); 233 if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) ) 234 $attachment = 'scroll'; 235 $attachment = " background-attachment: $attachment;"; 236 237 $style .= $image . $repeat . $position . $attachment; 238 } 239 ?> 240 <style type="text/css"> 241 body { <?php echo trim( $style ); ?> } 242 </style> 243 <?php 244 } 245 endif; 246 199 247 if ( !function_exists( 'bp_dtheme_header_style' ) ) : 200 248 /**
Note: See TracChangeset
for help on using the changeset viewer.