• 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

    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)
  • <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

    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

    (@vhelmink)

    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?

    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

    (@vhelmink)

    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 please use 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.