_custom_background_cb [ WordPress Function ]
_custom_background_cb ( No parameters )
| Access: |
|
| Defined at: |
|
Soorgelijke functies: add_custom_background, remove_custom_background, get_background_color, background_color, _custom_header_background_just_in_time
Default custom background callback.
Source
<?php
function _custom_background_cb() {
$background = get_background_image();
$color = get_background_color();
if ( ! $background && ! $color )
return;
$style = $color ? "background-color: #$color;" : '';
if ( $background ) {
$image = " background-image: url('$background');";
$repeat = get_theme_mod( 'background_repeat', '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', 'left' );
if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) )
$position = 'left';
$position = " background-position: top $position;";
$attachment = get_theme_mod( 'background_attachment', 'scroll' );
if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) )
$attachment = 'scroll';
$attachment = " background-attachment: $attachment;";
$style .= $image . $repeat . $position . $attachment;
}
?>
<style type="text/css">
body.custom-background { <?php echo trim( $style ); ?> }
</style>
<?php
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- _custom_background_cb (WordPress Function) - WPSeek.com
WordPress lookup for _custom_background_cb, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - _custom_background_cb() WordPress function reference ...
Default custom background callback. Signature. _custom_background_cb(). Return. (void). Source. function _custom_background_cb() { $background ...
queryposts.com - _custom_background_cb | A HitchHackers guide through WordPress
Feb 12, 2011 ... function _custom_background_cb() { $background = get_background_image(); $ color = get_background_color(); if ( ! $background && !
hitchhackerguide.com - _custom_background_cb
Function and Method Cross Reference. _custom_background_cb(). Defined at: / wp-includes/theme.php -> line 1098. No references found.
phpxref.ftwr.co.uk