[Resolved] Different body background image each page

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

Home Forums Support Different body background image each page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1869754
    ch1800

    Hello,

    Is it possible to have a different background image for body on different pages/posts?
    And without using any builder or block.

    I want to create groups of pages and posts with different background patterns according to their respective topic.

    Thanks.

    #1869965
    David
    Staff
    Customer Support

    Hi there,

    simplest way is to use a Hook Element to add your custom styles:

    https://docs.generatepress.com/article/hooks-element-overview/

    Create a new hook
    Add your CSS styles eg.

    <style>
    body {
        background-image: url('full-url-to-the-image');
        background-size: cover;
        background-repeat: no-repeat;
    }
    </style>

    Set the Hook to: wp_head
    Set the Display Rules to the pages / posts or post category etc. for where you want it displayed.

    Repeat the above for each different image group.

    #1869976
    ch1800

    Awesome, many thanks David!

    #1870076
    David
    Staff
    Customer Support

    Glad to be of help

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