background_image()
Display background image path.
Uses: get_background_image()
1 time — 0.002051 sec (very slow) | 50000 times — 1.90 sec (fast) | PHP 7.2.5, WP 5.0
No Hooks.
Return
null
. Nothing.
Usage
background_image();
Examples
#1 Display the URL in the css styles
<style> body.custom-background { background-image: url( '<?php background_image(); ?>' ); } </style>
For more examples, see get_background_image().
Changelog
Since 3.0.0 | Introduced. |
background_image() background image code WP 6.1.1
function background_image() { echo get_background_image(); }