I have a site that needs three different background images at the moment.
The most common one is just set by default via CSS.
The second one, for the home page, is set using the body class, as such:
background:url(images/topbg_h.jpg) no-repeat top center;
The one I’m having a problem with is defining a particular background for for landing pages. It will be the same image, and there will be many landing pages, so I don’t want to manually add a CSS class for each page.
to your <body> tag in your header.php file. This will auto-generate a bunch of classes for you on the body tag. I assume your landing pages will all be in the same category? Or, if they are pages instead of posts, they’ll all use the same page template. If they use the same page template, this function will add a class specifically for that.