get_background_image()
Retrieve background image for custom background.
Description
Return
(string)
Source
File: wp-includes/theme.php
function get_background_image() { return get_theme_mod( 'background_image', get_theme_support( 'custom-background', 'default-image' ) ); }
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
Use Theme Background Image as Fallback if No Featured Image Exists
This example could be used to detect whether the current Page/Post has a Featured Image set – if so, it will use the Featured Image as the page background, if not it will use the current active theme’s default background image. As is, this should be used in the of the page template, just after the call to wp_head():
Expand full source codeCollapse full source code