Support » Theme: Tasman » Page Background image

  • Resolved darrmik

    (@darrmik)


    I would like to be able to set the background image for each of my pages to be different from the main page. When I set the Featured image for a specific page, nothing happens. I still get the background image from my main page.

    Can the pages’ background image be set independently of each other? How can I do it?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello darrmik,

    Each page has a unique class in the <body> tag.

    You would first need to find the page/post ID – it’s actually hidden in your URL when you are logged in. Look for post= and that number is your page ID.

    You can also use a plugin to display your page ID.
    https://wordpress.org/plugins/reveal-ids-for-wp-admin-25/

    Then your CSS would be something like:

    .page-id-1234 {
        background-image: url('URL TO THE IMAGE');
        background-position: center;
        background-attachment: fixed; /*default is scroll*/
        background-size: 80px 60px;
        background-repeat: no-repeat;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    Hope this will helps you.

    Thanks.

    Thread Starter darrmik

    (@darrmik)

    Thank you for the code. Found that the background didn’t change until I added !important to background-image and then it worked perfectly.

    I also found that I can move the background image down the page by changing background-position to 0 500px; This moved the image 0 from the left and down 500px. Enough to shift the image out from under the header image.

    Thanx again!

    Darrmik

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page Background image’ is closed to new replies.