wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_custom_background_cb [ WordPress Function ]
| Zugriff: |
|
| Definiert in: |
|
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
}
?>
Beispiele [ wp-snippets.com ]
Top Google Suchergebnisse
- _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 | 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 - Using custom background function to style any other div
Nov 4, 2010 ... The function has the same code as _custom_background_cb() function, that you can found in theme.php and is responsible with building the ...
www.binarspace.com