Title: background_color
Published: April 25, 2014
Last modified: May 20, 2026

---

# background_color()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#wp--skip-link--target)

Displays background color value.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#source)󠁿

    ```php
    function background_color() {
    	echo get_background_color();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/theme.php#L1868)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/theme.php#L1868-L1870)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#related)󠁿

| Uses | Description | 
| [get_background_color()](https://developer.wordpress.org/reference/functions/get_background_color/)`wp-includes/theme.php` |

Retrieves value for custom background color.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/background_color/?output_format=md#comment-content-1514)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/background_color/#comment-1514)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fbackground_color%2F%23comment-1514)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fbackground_color%2F%23comment-1514)
 4. **Display a div with the theme’s background color.**
 5.     ```php
        <div id="background" style="background-color: #<?php background_color(); ?>">
        Content here.
        </div>
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fbackground_color%2F%3Freplytocom%3D1514%23feedback-editor-1514)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fbackground_color%2F)
before being able to contribute a note or feedback.