I am redesigning a wordpress blog.There are 5 different pages and i want to use different background images on each of them. Is there any way to do this?
And,i don’t want to change the background element. I want to change the background image of the #main element in my css..
I already have a css file so will overwriting the same elements using php affect anything?
Any help will be appreciated…Thanks
Each page or post will have a different class on the body, ie.
page-id-1234
post-id-4567
You can use this to your leverage inside your CSS file:
You could give each
div#main
(I assume it’s adiv
) another class. So<div id="main" class="pageOneBackground">...
<div id="main" class="pageTwoBackground">...
etc…
Then remove the
background-img
from thediv#main
and apply individualbackground-img
s to each new class.This won’t affect the php.
You can change the background with CSS/URL of image to apply to only the background of the post, only on the background of the home/main page, or both pages. http://wordpress.org/plugins/custom-post-background/screenshots/
If only only need to do it for 5 pages, set the main items of the body in your main CSS, for example:
Then on each page just add:
You can also see this on the source of this page.