• 0

Different background image on each page


Question

Posted · Report post

Hi

 

I am building a new site and the client wants to have a different background image on each of the main pages, not just in a section, but applied to the entire page. This used to be easy in the old Pagelines but not so much in the new DMS.

 

I wonder if someone could give me the custom css to use indicating which bits need to be unique for each page and also how I apply that code to the page itself? How do I apply a different class for each page of the site?

 

I only have a very basic understanding of code so please go easy on me!!!

 

Thanks

 

Allan 

 

 

Share this post


Link to post
Share on other sites

5 answers to this question

  • 0

Posted · Report post

Hi there, you can just add the code again without the .page-id and the new image url.

 

For example my test site is full width, so I'm applying the image to site wrap, this would be the code I used for the pages with the custom images, then the fallback image

 

body.page-id-22 .site-wrap{
background: url(" ");
}

body .site-wrap {
    background: url(" ");
}

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks James, that has got my individual pages sorted, but now, if I don't give a page a specific background image I just get a plain white background? Is there anything I can do so that If I don't select a specific image, then the page or post will fall back to a default one?

 

Thanks again

 

Allan 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Excellent! That works a treat, thanks James!!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for informing us the issue has been resolved.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now