• I am trying to build my first website, and I am facing some challenges regarding per post backgrounds. I have tried per post CSS, tried following different tutorials, such as this one. Tried different plugins. But the problem I am facing is the same across different operating systems and different browsers. The browser cannot really tell that it should load a different background when I am switching pages. If I reload the page along with scripts (ctrl + shift + R), the background changes once. After that, the new pages I visit have the same background. How do I address this problem?

Viewing 2 replies - 1 through 2 (of 2 total)
  • This sounds more like an issue with your caching plugin.

    Can you try this? Try deactivating all plugins. If that resolves the issue, reactivate each one individually until you find the cause.

    If that does not resolve the issue, try switching to the default theme for your version of WordPress to rule-out a theme-specific issue (theme functions can interfere like plugins).

    You can use a page-specific class from the body tag to target the CSS to a specific page – so for example, your “about” page body tag looks like:

    <body class="page page-id-9 page-template-default single-author singular two-column right-sidebar">

    So the CSS would be:

    body.page-id-9 {
       background-image: url("FILE PATH TO IMAGE");
    }

    You may also try this CSS only solution https://wordpress.stackexchange.com/a/173307/43555

    You can also try this plugin
    https://www.ads-software.com/plugins/fully-background-manager/screenshots/

    Cheers!

    Hi, can you post a link to your site?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add per post background the right way?’ is closed to new replies.