Title: background_image
Published: April 25, 2014
Last modified: February 24, 2026

---

# background_image()

## In this article

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

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

Displays background image path.

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

    ```php
    function background_image() {
    	echo get_background_image();
    }
    ```

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

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

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

Retrieves background image for custom background.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/background_image/?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_image/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/functions/background_image/?output_format=md#comment-content-1485)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/background_image/#comment-1485)
 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_image%2F%23comment-1485)
     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_image%2F%23comment-1485)
 4.  **Display background image**
      `<img src="" alt="" />`
 5.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fbackground_image%2F%3Freplytocom%3D1485%23feedback-editor-1485)
 6.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/background_image/?output_format=md#comment-content-1766)
 7.    [rabmalin](https://profiles.wordpress.org/rabmalin/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/background_image/#comment-1766)
 8.  [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_image%2F%23comment-1766)
     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_image%2F%23comment-1766)
 9.  **Display background image**
 10.     ```php
         <img src="<?php background_image(); ?>" alt="" />
         ```
     
 11.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fbackground_image%2F%3Freplytocom%3D1766%23feedback-editor-1766)

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