de

wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren




_custom_background_cb [ WordPress Function ]

_custom_background_cb ( Keine Parameter )
Zugriff:
  • protected
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

Mehr ...

Nutzerduskussionen [ wordpress.org ]

0 Nutzerkommentare

Noch keine. Sei der Erste!

Neu hinzufügen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics