Make WordPress Core


Ignore:
Timestamp:
03/03/2010 05:10:43 PM (17 years ago)
Author:
ryan
Message:

Background color selection. Props lancewillett. see #12186

File:
1 edited

Legend:

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

    r13469 r13574  
    13581358 */
    13591359function get_background_image() {
    1360         $default =  defined('BACKGROUND_IMAGE') ? BACKGROUND_IMAGE : '';
     1360        $default = defined('BACKGROUND_IMAGE') ? BACKGROUND_IMAGE : '';
    13611361
    13621362        return get_theme_mod('background_image', $default);
    … …  
    13701370function background_image() {
    13711371        echo get_background_image();
     1372}
     1373
     1374/**
     1375 * Retrieve value for custom background color.
     1376 *
     1377 * @since 3.0.0
     1378 * @uses BACKGROUND_COLOR
     1379 *
     1380 * @return string
     1381 */
     1382function get_background_color() {
     1383        $default = defined('BACKGROUND_COLOR') ? BACKGROUND_COLOR : '';
     1384
     1385        return get_theme_mod('background_color', $default);
     1386}
     1387
     1388/**
     1389 * Display background color value.
     1390 *
     1391 * @since 3.0.0
     1392 */
     1393function background_color() {
     1394        echo get_background_color();
    13721395}
    13731396
    … …  
    14381461<style type="text/css">
    14391462body {
    1440         background-image:url('<?php background_image(); ?>');
     1463        background-color: #<?php background_color(); ?>;
     1464        background-image: url('<?php background_image(); ?>');
    14411465        <?php echo $repeat; ?>
    14421466        <?php echo $position; ?>
Note: See TracChangeset for help on using the changeset viewer.