Title: Adding background to a single page
Last modified: August 20, 2016

---

# Adding background to a single page

 *  [vhelmink](https://wordpress.org/support/users/vhelmink/)
 * (@vhelmink)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/adding-background-to-a-single-page/)
 * Hello!
 * I am hoping someone can help me figure out this issue. This is the page I am 
   working on: [http://www.brightideastech.ca/?page_id=46](http://www.brightideastech.ca/?page_id=46)
 * I am currently trying to make the “notepaper” jpeg, fill the white area as a 
   background. I have tried just a simple <body background=”your background image
   name.gif”> code in the HTML section. I thought about toying with the CSS but 
   haven’t dabbled with CSS in years.
 * WordPress is new to me so I may be missing something very basic. I’m not quite
   sure how to define single pages to alter the background as I’ve seen suggested
   in other threads.
 * Thanks for any help you can offer. I appreciate it!

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

 *  [Mukesh Panchal](https://wordpress.org/support/users/mukesh27/)
 * (@mukesh27)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/adding-background-to-a-single-page/#post-2769286)
 *     ```
       <body <?php body_class(); ?>>
   
        <?php	if (is_front_page()){ ?>	
   
       		<div class="page page-id-46 page-template-default custom-background">
                <?php } else { ?>
   
       		<div id="main-inner">
   
         <?php } ?>
       ```
   
 * put in header.php
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/adding-background-to-a-single-page/#post-2769364)
 * Since you’re using the `body_class()` template tag, you already have all of the
   CSS selectors you need. Just add the appropriate CSS definitions.
 * For a page with an ID of 46, you can target: `body.page-id-46` in your CSS.
 *  Thread Starter [vhelmink](https://wordpress.org/support/users/vhelmink/)
 * (@vhelmink)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/adding-background-to-a-single-page/#post-2769411)
 * Thanks for your replies…
 * Sorry, I’m not quite following what you mean. I have copied the code provided
   by mukesh27 into the header.php section. However the background image still hasn’t
   changed. Should I be putting the image URL in somewhere?
 *  [Frumph](https://wordpress.org/support/users/frumph/)
 * (@frumph)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/adding-background-to-a-single-page/#post-2769435)
 * Chip is more correct on this then mukesh
 * Add this to the end of your style.css file (or if you use theme companion or 
   a child theme)
 *     ```
       body.page-id-46 {
                 background: url('http://pathtowhereveryourimage.jpgis') repeat;
       }
       ```
   
 * What this is saying, that on the body class, page-id-46 whatever page that is,
   change the background to that.
    (of course change the http:// to your image you
   want to use as the background.)
 * So you’re pretty much identifying in the CSS what page it is and the change of
   the background.
 *  Thread Starter [vhelmink](https://wordpress.org/support/users/vhelmink/)
 * (@vhelmink)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/adding-background-to-a-single-page/#post-2769485)
 * I am sorry to be difficult. I appreciate the help so far. I must be missing something
   still. I have copied the code Frumph provided and put it in the Stylesheet (style.
   css). I changed the URL to the picture URL, so it looks like this:
 *     ```
       body.page-id-46 {
                 background: url("http://www.brightideastech.ca/wp-content/uploads/2011/06/notepaper1-e1337293223308.jpg") repeat;
       }
       ```
   
 * The full Stylesheet code looks like this:
 * _[ **One thousand, three hundred and forty-five (1,345) lines of code moderated.**
   For more than [**10 lines of code**](http://codex.wordpress.org/Forum_Welcome#Posting_Code)
   please use [pastebin.com](http://pastebin.com/) instead. ]_
 *  I have tried moving the code around inside the css document in case that it 
   is in the wrong spot. However that doesn’t seem to change anything.
 * Thank you again!

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

The topic ‘Adding background to a single page’ is closed to new replies.

 * 5 replies
 * 4 participants
 * Last reply from: [vhelmink](https://wordpress.org/support/users/vhelmink/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/adding-background-to-a-single-page/#post-2769485)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
