WordPress.org

Ready to get started?Download WordPress

Forums

Page Background Images (6 posts)

  1. vsomething
    Member
    Posted 4 years ago #

    I am trying to add a background to different pages. 4 different pages each with it's own different background. Anyone?

  2. Edward Caissie
    Theme Review Admin
    Posted 4 years ago #

    If your theme uses the body_class() function then each page should have a unique class such as possibly 'page-id-6'.

    You can then use that class in your style.css file to assign a background, for example:

    .page-id-6 {
      background: transparent url(images/your-image-file) repeat 0 0;
    }

    If you theme does not use the body_class() functions it is easily added, and if you are looking for more information about the function here is a bit of reading: http://www.nathanrice.net/blog/wordpress-2-8-and-the-body_class-function/

  3. bobtem
    Member
    Posted 4 years ago #

    Cais,
    Here is a WP site I'm building http://sub.whoopdesign.com/

    I followed your advice as per above for trying to change the background image on just this page http://sub.whoopdesign.com/?page_id=28 but instead I get just a blank background.

    Could you advise me on what else I need to do.

  4. s_ha_dum
    Member
    Posted 4 years ago #

    Your image isn't being found.

  5. bobtem
    Member
    Posted 4 years ago #

    Ok, I put in the full url filepath and it works now, but shouldn't it just be able to locate the image using the "images/your_image_file" structure?

  6. s_ha_dum
    Member
    Posted 4 years ago #

    ...shouldn't it just be able to locate the image using the "images/your_image_file" structure?

    It depends. From inside the stylesheet that works just fine. From most other places in WordPress relative URLs don't work.

Topic Closed

This topic has been closed to new replies.

About this Topic