Site logo

[Resolved] Different background image on each page

Home Forums Support [Resolved] Different background image on each page

Home Forums Support Different background image on each page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #263564
    Tully

    Hi Tom, I’d like to have a different background image on each page, and be able to adjust the position, fixed or scroll, size etc?

    #263565
    Leo
    Staff
    Customer Support

    Hi Tully,

    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.

    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/

    Let me know if this makes sense.

    #263567
    Leo
    Staff
    Customer Support

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

    #263585
    Tully

    Thanks Leo, perfect!

    #263596
    Leo
    Staff
    Customer Support

    You’re welcome 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.