Title: background for single post?
Last modified: August 20, 2016

---

# background for single post?

 *  Resolved [max-sewell](https://wordpress.org/support/users/max-sewell/)
 * (@max-sewell)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/background-for-single-post/)
 * [http://bizbuzmarketing.com/wordpress/?p=1](http://bizbuzmarketing.com/wordpress/?p=1)
 * Hi,
 * I’ve used the code below to incorporate a background for the home page and another
   other pages. I’d like to add the latter image for single posts (single.php). 
   I”m not talking about a post background, but a background for the whole page 
   displaying the post. Can anyone advise?
 * Thanks for any help you can give,
 * Max
 *     ```
       <?php if (is_home()): ?>
       	<style type="text/css">
       	body {background: url(http://bizbuzmarketing.com/wordpress/wp-content/themes/toolbox/images/bb-bkgd.jpg); background-position: left top; background-repeat: no-repeat;}
       	</style>
       <?php elseif (is_page() ): ?>
       	<style type="text/css">
       	body {background: url(http://bizbuzmarketing.com/wordpress/wp-content/themes/toolbox/images/bb-bkgd-2.jpg); background-position: center top; background-repeat: no-repeat;}
       	</style>
       <?php endif; ?>
       ```
   
 * _[Please post code snippets between backticks or use the code button.]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [max-sewell](https://wordpress.org/support/users/max-sewell/)
 * (@max-sewell)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/background-for-single-post/#post-2435264)
 * Sorry. Found the answer.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/background-for-single-post/#post-2435265)
 * Try using the CSS classes generated on the `<body>` tag instead.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘background for single post?’ is closed to new replies.

## Tags

 * [background](https://wordpress.org/support/topic-tag/background/)
 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/background-for-single-post/#post-2435265)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
