Make WordPress Core


Ignore:
Timestamp:
02/18/2010 12:14:56 AM (15 years ago)
Author:
ryan
Message:

Add some options to custom background admin. Needs styling. see #12186

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r13041 r13186  
    13991399
    14001400    $repeat = get_theme_mod('background_repeat');
    1401     $repeat = $repeat ? '' : ' no-repeat';
     1401    if ( 'no-repeat' == $repeat )
     1402        $repeat = 'background-repeat: no-repeat;';
     1403    else
     1404        $repeat = 'background-repeat: repeat;';
     1405    $position = get_theme_mod('background_position');
     1406    if  ( 'center' == $position )
     1407        $position = 'background-position: center;';
     1408    elseif ( 'right' == $position )
     1409        $position = 'background-position: right;';
     1410    else
     1411        $position = 'background-position: left;';
     1412    $attachment = get_theme_mod('background_attachment');
     1413    if ( 'scroll' == $attachment )
     1414        $attachment = 'background-attachment: scroll;';
     1415    else
     1416        $attachment = 'background-attachment: fixed;';
    14021417?>
    14031418<style type="text/css">
    14041419body {
    1405     background: url('<?php background_image(); ?>') fixed <?php echo $repeat ?>;
     1420    background-image:url('<?php background_image(); ?>');
     1421    <?php echo $repeat; ?>
     1422    <?php echo $position; ?>
     1423    <?php echo $attachment; ?>
    14061424}
    14071425</style>
Note: See TracChangeset for help on using the changeset viewer.