Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   [SOLVED] different background images for individual posts/pages (http://forum.bytesforall.com/showthread.php?t=9525)

goonygoogoo Sep 9, 2010 01:21 PM

[SOLVED] different background images for individual posts/pages
I've been looking through the forum for an hour plus

I want to be able to give indiviual pages different backgrounds within the layout container.

I looked here


but i can't seem to get the code right.

I have put

body#body-page-id-2 div.page{
into my css inserts
all i want to do is change the background of the about page on my site within the layout container.
im pretty darn sure that the image call is correct i am just effing up the div or the page id i don't know but i'm sure it's simple.


goonygoogoo Sep 9, 2010 04:11 PM

one thing i am wondering is if having background defined within the main body settings overrides any css inserts.

also the coding i sited was just the most recent iteration in desperation.

juggledad Sep 10, 2010 04:04 AM

see http://forum.bytesforall.com/showthr...ght=image+page

DragNfLy Sep 10, 2010 06:14 AM


I am struggling with a similar problem if not exactly the same.

Been at it for 2 days now and have tried many different possibilities.

I have found this code to be the closest match:

body.home td#middle {
background-image: url("/wp-content/themes/atahualpa353/images/middle.jpg");
background-position:center top;

.... but I have a page set as my home page and am not sure if changing the first line ( body.home td#middle { ) to reflect the page ID will work.

I also need a different image for each pages' (layout area) background.
I too cannot seem to get the code right.

Can anyone please help a newb here.

DragNfLy Sep 10, 2010 06:16 AM

Just saw your post now juggledad > will give this one a try and get back to this thread.


DragNfLy Sep 10, 2010 06:56 AM

Still no luck here. I am not getting any background image with this code.

The site is here > decodance.co.za

Please have a look

goonygoogoo Sep 10, 2010 11:57 AM

my current code reads

body.page-id-2 div#image {

I am pretty sure the "body.page-id-2" is ok
and i know the url call is right. I think i am just messing up the div not sure what it needs to be assigned to

td#middle is real close it works for the post area of the page but not the outlying area under the widgets header etc.

does w3 have a good primer on figuring out div?

lmilesw Sep 10, 2010 12:21 PM

How about just using
HTML Code:

body.page-id-2 {

goonygoogoo Sep 10, 2010 12:23 PM

Sweet Jesus hallelujah.

the code that worked for those who come after.

body.page-id-2 div#container {

now i just have to figure out what backgrounds i want to use now that i know how to do it!

and thank you to the mods

goonygoogoo Sep 10, 2010 12:57 PM

[SOLVED] different background images for individual posts/pages
I just finished working through a problem but i thought i would explain the solution for those who come after.

I wanted to alter the background within the container for individual pages

the code that worked
inserted into ato css inserts

body.page-id-2 div#container {

My understanding is that the code breaks down like this

"body.page-id-2" is the opening call it specifies what page you want to alter.
you can find out what that is by looking at the source code of the page in mozilla.

mine looked like this

<body class="page page-id-2 page-template page-template-default logged-in">
<div id="wrapper">
<div id="container">

you can see "page-id-2" that's what you want

"div#container" specifies what area of the page you are altering in my case the entire middle of the page.

you can leave it blank and that will alter the background behind the container or you can specify further like is td#middle which will alter only the middle part of the layout container i.e.

body.page-id-2 {


body.page-id-2 td#middle {

this finishes the "where" now onto the "what"

"background-image:url(/wp-content/themes/atahualpa/images/aboutbg.gif);" is what is encased in the {} it is the actual alteration to the page that you are performing in my case i am changing the background. note in my case aboutbg.gif is an image i created in photoshop that is the exact width of the fixed width container so i don't need to specify repeat or no repeat etc by default it repeats down the page.

this code could be anything you have already specified where exactly you want to make changes it need not be to the background it could also befont or font size or just about anything i would guess

hope that helps.

All times are GMT -6. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.