get_background_image() WordPress Function

The get_background_image() function is used to retrieve the background image for a specific element on a WordPress site. This function can be used to get the background image for the entire site, or for a specific page or post. It can also be used to get the background image for a specific element on a page or post.

get_background_image() #

Retrieves background image for custom background.


Return

(string)


Top ↑

Source

File: wp-includes/theme.php

function get_background_image() {
	return get_theme_mod( 'background_image', get_theme_support( 'custom-background', 'default-image' ) );
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More