Cyber Week Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Differents Background images

Home Forums Support Differents Background images

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #338395
    Evadex

    Hi,
    I would like to know how to use an background image for home and differents background images for other templates ?
    I tried to use a child theme and a child template but when I put a picture in the body of my home child template, I can see this picture in every templates.
    Have you got a solution for a beginner like me ?
    Thank you very much !
    Yvan
    FYI : I’m using GP Premium 1.3.1

    GP Premium 1.3.1
    #338416
    Leo
    Staff
    Customer Support

    Hi there,

    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.

    Or you can use a plugin: https://wordpress.org/plugins/reveal-ids-for-wp-admin-25/

    Then your CSS would be something like this:

    .page-id-xxxx {
        background-image: url('URL TO THE IMAGE');
    }

    Let me know if this makes sense.

    #338450
    Evadex

    Hi Leo,
    Thank you for your answer but I don’t know if I have to use your code into the style.css or other ? In the child theme or Parent ?
    Thank you very much for your help

    #338452
    Leo
    Staff
    Customer Support

    Are you going to do lots of customization outside of the customizer?

    If not you might not need a child theme.

    The easiest way to achieve this is actually to use Tom’s Simple CSS plugin. It has a meta box for each page so you can just add this CSS in without knowing the page ID.

    body {
        background-image: url('URL TO THE IMAGE');
    }

    Simple CSS: https://docs.generatepress.com/article/adding-css/#simple-css

    #338476
    Evadex

    As Tina Turner said : “you’re simply the best” !
    Simple Css, your code and a good url after that it’s perfect !
    Thank you very much and have a good day or evening !
    Best regards
    An happy French beginner

    #338505
    Leo
    Staff
    Customer Support

    You’re very welcome πŸ™‚

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