WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get background color

Description

Retrieve the custom background color for the current active theme.

Usage

<?php get_background_color(); ?>

Parameters

None.

Return Values

(string) 
The hex value of the background color without the preceding hash tag. Returns an empty string if custom backgrounds are not supported by the current theme or if none is set and no default is given.

Examples

<?php
$background_color = get_background_color();

echo "The current background color for your theme is: #" . $background_color . "."; // e6e6e6
?>

Notes

Change Log

Since: 3.0.0

Source File

get_background_color() is located in wp-includes/theme.php.

Related

background_color(), background_image(), get_background_image()

This article is marked as in need of editing. You can help Codex by editing it.
See also index of Function Reference and index of Template Tags.